cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1057
Views
5
Helpful
3
Replies

Sync from error

Dan Frey
Cisco Employee
Cisco Employee

What can be done to address this error?   I did update ncs-start-java-vm with opts=`add_if_not_contains "${opts}" "-Xmx" "" "1G"` and restarted ncs.

admin@ncs% request devices device PD-P1-BR1 sync-from

result false

info External error in the NED implementation for device PD-P1-BR1: Java heap space

[ok][2018-04-05 13:48:48]

Neds reload looks good.

admin@ncs> request packages reload

reload-result {

    package a10-acos

    result true

}

reload-result {

    package cisco-ios

    result true

}

reload-result {

    package cisco-iosxr

    result true

}

reload-result {

    package cisco-nx

    result true

}

reload-result {

    package dell-ftos

    result true

}

reload-result {

    package juniper-junos

    result true

}

[ok][2018-04-05 13:46:53]

3 Replies 3

snovello
Cisco Employee
Cisco Employee

You don't have to change the ncs-start-java-vm to alter java heap space. There is an environment variable you can set.

export NCS_JAVA_VM_OPTIONS=-Xmx2G

I have this in my .bash_profile

Also you can verify the options passed to java by looking at logs/ncs-java-vm.log

  Where you will see a message like

Starting java-vm with options:

'-Xmx2G -classpath :/Users/snovello/NSO/4.6/java/jar/* -Dport=4569 -Djava.awt.headless=true -Djava.security.egd=file:/dev/./urandom -Dfile.encoding=UTF-8'

NCS JVM STARTING

my suggestion is to increase the heap size further, and look into the log file if there is any indication as to what might be using up your heap.

Tried 2G and 4G option, getting same error when performing sync-from.   Here is the ncs-java-vm.log.

Starting java-vm with options:\n'-Xmx4G -classpath :/home/dan.frey/ncs/4.6/java/jar/* -Dport=4569 -Djava.security.egd=file:/dev/./urandom -Dfile.encoding=UTF-8'

NCS JVM STARTING

NcsLogger applying Default configuration!

<INFO> 08-Apr-2018::08:27:12.803 NcsMain JVM-Launcher: - CONNECTED TO to NCS --> Socket[addr=/127.0.0.1,port=4569,localport=46226]

<INFO> 08-Apr-2018::08:27:12.819 NcsMain JVM-Launcher: - READ SOCKET =>

<INFO> 08-Apr-2018::08:27:12.825 NcsMain JVM-Launcher: -  <= GOT INIT_JVM

JMXURL : service:jmx:rmi://127.0.0.1:9901/jndi/rmi://127.0.0.1:9902/ncs

<INFO> 08-Apr-2018::08:27:13.452 NcsMain JVM-Launcher: - ALARM SERVICE STARTED

<INFO> 08-Apr-2018::08:27:13.453 NcsMain JVM-Launcher: - DONE COMMAND --> INIT_JVM

<INFO> 08-Apr-2018::08:27:13.453 NcsMain JVM-Launcher: - READ SOCKET =>

<INFO> 08-Apr-2018::08:27:13.453 NcsMain JVM-Launcher: -  <= GOT LOAD_SHARED_JARS

<INFO> 08-Apr-2018::08:27:13.454 NcsMain JVM-Launcher: - LOAD SHARED PACKAGE ["cisco-ios"] -->

<INFO> 08-Apr-2018::08:27:13.454 NcsMain JVM-Launcher: - loading shared jar: file:///home/dan.frey/ncs/ncs-working/state/packages-in-use/1/cisco-ios/shared-jar/ios-ns.jar

<INFO> 08-Apr-2018::08:27:13.454 NcsMain JVM-Launcher: - LOAD SHARED PACKAGE ["cisco-ios"] --> OK

<INFO> 08-Apr-2018::08:27:13.454 NcsMain JVM-Launcher: - DONE COMMAND --> LOAD_SHARED_JARS

<INFO> 08-Apr-2018::08:27:13.454 NcsMain JVM-Launcher: - READ SOCKET =>

<INFO> 08-Apr-2018::08:27:13.454 NcsMain JVM-Launcher: -  <= GOT LOAD_PACKAGE

<INFO> 08-Apr-2018::08:27:13.454 NcsMain JVM-Launcher: - FOUND TYPE: upgrade

<INFO> 08-Apr-2018::08:27:13.455 NcsMain JVM-Launcher: - FOUND TYPE: ned

<INFO> 08-Apr-2018::08:27:13.455 NcsMain JVM-Launcher: - LOADING PACKAGE ["cisco-ios"] -->

<WARN> 08-Apr-2018::08:27:13.473 ResourceManager JVM-Launcher: - Resource annotated field :IOSNedCli::mm already set, no resource injection performed

<INFO> 08-Apr-2018::08:27:13.473 NcsMain JVM-Launcher: - LOADING PACKAGE ["cisco-ios"] --> LOADED

<INFO> 08-Apr-2018::08:27:13.473 NcsMain JVM-Launcher: - DONE COMMAND --> LOAD_PACKAGE

<INFO> 08-Apr-2018::08:27:13.474 NcsMain JVM-Launcher: - READ SOCKET =>

<INFO> 08-Apr-2018::08:27:13.474 NcsMain JVM-Launcher: -  <= GOT INSTANTIATE_COMPONENT

<INFO> 08-Apr-2018::08:27:13.474 NcsMain JVM-Launcher: - INSTANTIATE COMPONENT ["cisco-ios:upgrade-ned-id"] -->

<INFO> 08-Apr-2018::08:27:13.474 NcsMain JVM-Launcher: - => Nothing to deploy for component cisco-ios:upgrade-ned-id

<INFO> 08-Apr-2018::08:27:13.474 NcsMain JVM-Launcher: - INSTANTIATE COMPONENT ["cisco-ios:upgrade-ned-id"] --> DONE

<INFO> 08-Apr-2018::08:27:13.474 NcsMain JVM-Launcher: - DONE COMMAND --> INSTANTIATE_COMPONENT

<INFO> 08-Apr-2018::08:27:13.474 NcsMain JVM-Launcher: - READ SOCKET =>

<INFO> 08-Apr-2018::08:27:13.474 NcsMain JVM-Launcher: -  <= GOT INSTANTIATE_COMPONENT

<INFO> 08-Apr-2018::08:27:13.475 NcsMain JVM-Launcher: - INSTANTIATE COMPONENT ["cisco-ios:cisco-ios"] -->

<INFO> 08-Apr-2018::08:27:13.475 NcsMain JVM-Launcher: - INSTANTIATE COMPONENT ["cisco-ios:cisco-ios"] --> DONE

<INFO> 08-Apr-2018::08:27:13.475 NcsMain JVM-Launcher: - DONE COMMAND --> INSTANTIATE_COMPONENT

<INFO> 08-Apr-2018::08:27:13.475 NcsMain JVM-Launcher: - READ SOCKET =>

<INFO> 08-Apr-2018::08:27:13.476 NcsMain JVM-Launcher: -  <= GOT DONE_LOADING

<INFO> 08-Apr-2018::08:27:13.476 NcsMain JVM-Launcher: - DONE LOADING  -->

<INFO> 08-Apr-2018::08:27:13.477 NcsMain JVM-Launcher: - DONE LOADING --> OK

<INFO> 08-Apr-2018::08:27:13.477 NcsMain JVM-Launcher: - DONE COMMAND --> DONE_LOADING

<INFO> 08-Apr-2018::08:27:13.477 NcsMain JVM-Launcher: - READ SOCKET =>

<ERROR> 08-Apr-2018::08:28:15.725 NedWorker Ned-Worker-Thread-0: - NedWorker error for ned_get_trans_id

java.lang.OutOfMemoryError: Java heap space

at java.util.Arrays.copyOf(Arrays.java:3332)

at java.lang.AbstractStringBuilder.ensureCapacityInternal(AbstractStringBuilder.java:124)

at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:448)

at java.lang.StringBuilder.append(StringBuilder.java:136)

at com.tailf.packages.ned.ios.IOSNedCli.getTransId(IOSNedCli.java:591)

at com.tailf.ned.NedWorker.dorun(NedWorker.java:1763)

at com.tailf.ned.NedWorker.run(NedWorker.java:294)

Hi Dan,

You may want to double check that your VM has the memory size to support that heap size, if that is so, then I would open a TAC case. There should be no need for 4G of memory to start a single IOS NED, I use that 2G setting because I often have to load 5 or more NEDs and various other packages.

Stefano

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the NSO Developer community:

Recognize Your Peers