Appian Technical Support might ask you to provide them with Java heap dumps to troubleshoot memory leaks, performance issues, etc. There are different ways of generating this file. This article describes the most common way of generating a heap dump. Please note that these commands should be run on the application server machine when collecting a heap dump of the application server's Java process.
<PID of Java Process>
jmap -dump:format=b,file="<APPIAN_HOME>/logs/heapdump.hprof" <PID of Java Process>
The jmap command will generate a file named heapdump.hprof under <APPIAN_HOME>/logs.
If Technical Support requests that you capture a heap dump without running Java Garbage Collection, use the following command:
jmap -dump:live,format=b,file="<APPIAN_HOME>/logs/heapdump.hprof" <PID of Java Process>
To determine the ID of the Java process, run ps -ef | grep java in Linux or open Windows Task Manager and go to the Processes tab in Windows.
ps -ef | grep java
Note: the raw heap dump file may contain sensitive information from your Appian environment. For this reason, Appian Technical Support will ask you to run heap dump analysis on the raw output to generate an analysis file that does not contain any sensitive data. There is a range of software that can perform heap dump analysis. The steps for performing this analysis using the Java Memory Analyzer are as follows:
./ParseHeapDump.sh|bat "<APPIAN_HOME>/logs/heapdump.hprof" org.eclipse.mat.api:suspects
The analysis file will then be available at <APPIAN_HOME>/logs/Leak_Suspects.zip
For scenarios where there's no leak but only high heap usage that eventually goes down, the leak suspects report will show a considerably smaller size of the heap when compared to the original heap dump size. This is because the parsing removes unreachable objects simulating what garbage collection will eventually do.
If you're analyzing something that is not a leak, then you don't want the unreachable objects to be removed because you need to know what needs to be optimized that's consuming too much heap.
To get that information in the report add the -keep_unreachable_objects flag:
./ParseHeapDump.sh|bat -keep_unreachable_objects "<APPIAN_HOME>/logs/heapdump.hprof" org.eclipse.mat.api:suspects
This article applies to all versions of Appian.
Last Reviewed: March 2017
© 2022 Appian. All rights reserved.