NonStop Server for Java 6.0 Programmer's Reference
to stdout is suppressed. Setting the _JAVA_BINARY_HEAPDUMP environment variable along with
_JAVA_HEAPDUMP_ONLY produces a binary format heap dump and instead of ASCII, the
SIGWINCH is sent to the process.
NOTE: Before producing the heap dump, JVM performs a full GC.
Other HeapDump Options
In addition to -XX:+HeapDump, there are three other HeapDump options available:
-XX:+HeapDumpOnCtrlBreak, -XX:+HeapDumpOnOutOfMemoryError, and
-XX:+HeapDumpOnly. The following table lists the heap dump options.
FilenameFormatTriggerOption
Set the _JAVA_BINARY_HEAPDUMP environment variable to
get binary
java_<pid>_<date>_<time>_heapDump.hprof.txt
ASCIISIGQUIT-XX:+HeapDump
java_<pid>.hprof.<millitime>BinarySIGQUIT-XX:+HeapDumpOnCtrlBreak
java_<pid>.hprof or the file specified by
-XX:HeapDumpPath=file
BinaryOut of
Memory
-XX:+HeapDumpOnOutOfMemoryError
Set the _JAVA_BINARY_HEAPDUMP environment variable to
get binary
java_<pid>_<date>_<time>_heapDump.hprof.txt
ASCIISIGWINCH-XX:+HeapDumpOnly
The heap dump options are described as follows:
-XX:+HeapDumpOnCtrlBreak
It enables taking snapshots of the Java heap when a SIGQUIT signal is sent to the Java process,
without using the JVMTI-based -Xrunhprof:heap=dump option. This option is similar to the
-XX:+HeapDump option, except the output format, which is in binary hprof format and the output
is placed into a filename with the following naming convention:
java_<pid>.hprof.<millitime>.
If the HP environment variable _JAVA_HEAPDUMP is set and the -XX:+HeapDumpOnCtrlBreak
option is specified, both hprof ASCII and binary dump files are created when a SIGQUIT is sent
to the process. For example, the following files are created: java_27298.hprof.1152743593943
and java_27298_060712_153313_heapDump.hprof.txt. If JAVA_BINARY_HEAPDUMP is set
and the -Xrunhprof:heap=dump command is run, both hprof ASCII and binary files are produced
for this option.
-XX:+HeapDumpOnOutOfMemoryError
This option enables dumping the Java heap when the Java process encounters a
java.lang.OutOfMemoryError exception. . The heap dump file name defaults to
java_pid<pid>.hprof in the current working directory. The option -XX:HeapDumpPath=file
can be used to specify the heap dump file name or a directory where the heap dump file must be
created. The only heap dump format generated by the -XX:+HeapDumpOnOutOfMemoryError
option is the hprof binary format.
NOTE: The -XX:+HeapDumpOnOutOfMemoryError option does not work with the low-pause
collector (option -XX:+UseConcMarkSweepGC).
-XX:+HeapDumpOnly
The -XX:+HeapDumpOnly option or the _JAVA_HEAPDUMP_ONLY environment variable can be
used to enable heap dumps using the SIGWINCH signal (signal 12). This interface is provided to
separate the generation of thread and trace information triggered via SIGQUIT from the heap
Java GC Profiling 65










