For high heap memory usage problems there is a need to generate heap dump manually. The heap dump is the only way to find out what objects are occupying the heap memory. There are debugging tools like Jmap, JVisualVM supplied with JDK, which can be used to generate the heap dumps.
However, there are situations when it is not possible to install a JDK on the server where a node is running. This article will describe a way to generate a heap dump without installing the JDK on the node machine.
Issue/Introduction
Generating a heap dump without installing Java Development Kit(JDK)
Environment
OS: All Supported Operating Systems
Resolution
The BPM or SOA Node can be monitored using the remote connection. This way the JDK tools can be used from a remote machine. See "Monitoring Your BPM Node" in references.
In the situations when the JMX remote port cannot be enabled, follow the below steps to generate heap dump without installing JDK on the node machine -
A. Identify the exact Java version -
- Get the java location from java.library property from <TIBCO_HOME>/amx/3.3/scripts/rpflauncher_classpath_3.3.0.tra.
For example, java.library=/opt/tibco/bpm_home/tibcojre64/1.7.0/lib/amd64/server/libjvm.so
In this case, the JAVA_HOME is /opt/tibco/bpm_home/tibcojre64/1.7.0
From <JAVA_HOME>/bin, run the command:
./java -version
B. Download a similar version of JDK from Oracle and install it on a remote machine.
C. Copy the <JDK_HOME>\jre\lib\amd64\libattach.so from the remote machine to the node machine - any directory. Say /home/xyz/lib
To generate a heap dump -
1. Set the library path to libattach.so. For example, On linux it is - export LD_LIBRARY_PATH=/home/xyz/lib
2. Navigate to a directory which has enough disk space. cd /home/xyz
4. Run the following command to generate the heap dump named as "heap.bin" in the current directory(/home/xyz) :
<JAVA_HOME>/bin/java -classpath <JAVA_HOME>/lib/tools.jar sun.tools.jmap.JMap -dump:format=b,file=heap.bin <Process ID or PID of the node>