A heap dump is a snapshot of the memory of a Java process. This is one of the tools we use when troubleshooting.
This article provides information about heap dumps and how is it relevant in troubleshooting.
A heap dump is useful when the instance is running out of memory and the common causes have already been addressed. A heap dump gives us a breakdown of all the objects that exist in the java heap at the time it was taken.
It's important to lower the size of the heap as much as possible before creating a heap dump. A very large heap is hard to analyze as significant resources are required for generating large heap dumps. A heap dump can also be useful in conjunction with garbage collection logs.
For generating heap dumps us the following commands:
$JIVE_HOME/java/bin/jmap -dump:format=b,file=heap.bin <pid_of_jive_process>
Add the following to webapp.custom_jvm_args (webapp) startup property and restart:
-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=<path to this heap dump file>
Heap dumps can be configured to be automatically generated when an instance runs out of memory or can be run manually. However, if a heap dump is not generated when an OutOfMemoryError is thrown, it is generally not at all useful. For analyzing heap dumps use Eclipse MAT.