How to generate a heap dump from an IBM JVM
Some IBM JVMs automatically generate a heap dump when an out-of-memory exception is thrown. You can also generate a heap dump in situations where you are using an IBM JVM and are unable to take a snapshot. You need to set the environment variables to allow heap dumps on request and to specify the format of the heap dump (with the exception of the out-of-memory situation described below).
You can generate a heap dump by sending a signal to the process (CTRL+\ on UNIX and CTRL+Break on Windows). IBM_HEAP_DUMP and IBM_HEAPDUMP must be set before taking a heap dump.
The following environment variables allow the JVM to generate a list of all the objects in the Java heap.
IBM Dump Task Action
Add Java environment variables On your system, set the environment variables:
IBM_HEAP_DUMP=true
IBM_HEAPDUMP=true
IBM_HEAPDUMP_OUTOFMEMORY=true
IBM_JAVACORE_OUTOFMEMORY=true
IBM_JAVA_HEAPDUMP_TEXT=true*
*If you set the environment variable IBM_JAVA_HEAPDUMP_TEXT=true, the JVM creates a text heap dump. If you set this environment variable to false, the JVM creates a PHD heap dump. The default setting is false. Text dumps are usually much larger than PHD dumps. JProbe can import either format, but with some versions of the JVM, PHD dumps are missing information about array types. Optionally, you can set the IBM_HEAPDUMPDIR=<directory> environment variable.
This environment variable controls the location where the heap dump file is saved. Starting with SDK 1.4.2, some variables automatically set by the JVM (IBM_HEAPDUMP_OUTOFMEMORY and IBM_JAVACORE_OUTOFMEMORY) can result in several heap dump files (heapdump##.txt) and Javacore files (javacore##.txt) being generated when the Java heap becomes exhausted. This can be disabled by setting the following environment variables:
IBM_HEAPDUMP_OUTOFMEMORY=false
IBM_JAVACORE_OUTOFMEMORY=false