KB Article #179423

create heap dumps and thread dumps for a B2Bi java process (ex : coreservices)

Problem

-- troubleshooting java memory issues (possible leak or unexpected memory size) or a java process that hangs

Resolution

* make sure JDK is installed on your machine. It must be the same JDK as the java version used in Integrator (it is defined in the environment variable $JAVA_HOME set in $CORE_ROOT/config/environment.dat)

* obtain pid of the java process you need to analyze (ex : coreservices process)

> ps -ef | grep coreservices

axway 24989 1589 2 09:41 pts/0 00:02:16 /opt/axway/b2bi/jre/bin/java -Dlog4j.configurationFile=file:////opt/axway/b2bi/Integrator/config/java/cs-log4j2.xml -Dio.netty.leakDetectionLevel=DISABLED -jar /opt/axway/b2bi/Integrator/java/lib/core-services.jar -c /opt/axway/b2bi/Integrator/local/config/runtime/coreservices/12_cs.xml -f /opt/axway/b2bi/Integrator/data/coreservices/b2bi_csstarted.dat

* create the heap dump

<jdk home dir>/bin/jmap -dump:live,format=b,file=<heap_name> <pid>

ex: /usr/java/jdk1.8.0_121/bin/jmap -dump:live,format=b,file=heap_coreservices 24989

* obtain the thread dump

<jdk home dir>/bin/jstack <pid> > <stack_name>

ex : /usr/java/jdk1.8.0_121/bin/jstack 24989 > stack_coreservices