Java Troubleshooting Guide for HP-UX Systems
With the -XX:+HeapDump option enabled, each time the process is sent a SIGQUIT signal, the
Java VM produces a snapshot of the Java heap in hprof ASCII format. The name of the file has
the following format: java_<pid>_<date>_<time>_heapDump.hprof.txt.
If _JAVA_HEAPDUMP_ONLY is set, then heap dumps are triggered by SIGVTALRM instead of
SIGQUIT for this option. Only the heap dump is produced; that is, the thread and trace dump
of the application to stdout is suppressed. Setting the _JAVA_BINARY_HEAPDUMP environment
variable along with _JAVA_HEAPDUMP_ONLY produces a binary format heap dump when the
SIGVTALRM is sent to the process instead of an ASCII one.
NOTE: A full GC is executed prior to taking the heap snapshot.
1.26.1 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 describes the four heap dump options. Additional
information on these three heap dump options is provided after the table.
Table 1-16 Overview of HeapDump Options
Filenamehprof FormatTriggerOption
java_<pid>_<date>_<time>_heapDump.hprof.txt
ASCII; set the
_JAVA_BINARY_HEAPDUMP
environment variable to
get binary
SIGQUIT-XX:+HeapDump
java_<pid>.hprof.<millitime>
Binary
SIGQUIT-XX:+HeapDumpOnCtrlBreak
java_<pid>.hprof or the file specified
by -XX:HeapDumpPath=file
BinaryOut of
Memory
-XX:+HeapDumpOnOutOfMemoryError
java_<pid>_<date>_<time>_heapDump.hprof.txt
ASCII; set the
_JAVA_BINARY_HEAPDUMP
environment variable to
get binary
SIGVTALRM-XX:+HeapDumpOnly
1.26.2 -XX:+HeapDumpOnCtrlBreak
The -XX:+HeapDumpOnCtrlBreak option is available beginning with SDK 1.4.2.11 and JDK
1.5.0.05. It enables the ability to take 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 -XX:+HeapDump except the output format 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 this option is specified, then both
hprof ASCII and binary dump files are created when a SIGQUIT is sent to the process. For
example, the following file names 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 given, then
both hprof ASCII and binary files are produced for this option.
1.26.3 -XX:+HeapDumpOnOutOfMemoryError
The-XX:+HeapDumpOnOutOfMemoryError option is available beginning with SDK 1.4.2.11
and JDK 1.5.0.04. This option enables dumping of the Java heap when an “Out Of Memory” error
condition occurs in the Java VM. The heap dump file name defaults to java_pid<pid>.hprof
in the current working directory. The option -XX:HeapDumpPath=file may be used to specify
the heap dump file name or a directory where the heap dump file should be created. The only
48 Diagnostic and Monitoring Tools and Options