HP (Hewlett-Packard) 5992-1918 TV Antenna User Manual


 
1.27 -XX:+HeapDump and _JAVA_HEAPDUMP Environment Variable
The -XX:+HeapDump option can be used to observe memory allocation in a running Java
application by taking snapshots of the heap over time. Another way to get heap dumps is to use
the _JAVA_HEAPDUMP environment variable; setting this environment variable allows memory
snapshots to be taken without making any modifications to the Java command line. In order to
enable this functionality, either use the command-line option or set the environment variable
(for example, export _JAVA_HEAPDUMP=1) before starting the Java application. This option
is available beginning with SDK 1.4.2.10 and JDK 1.5.0.03.
The output is similar to that produced by the -Xrunhprof:heap=dump option except that the
thread and trace information is not printed to the output file.
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.27.1 Other HeapDump Options
In addition to -XX:+HeapDump, there are three other HeapDump options available:
-XX:+HeapDumpOnCtrlBreak , -XX:+HeapDumpOnOutOfMemoryError, and
-XX:+HeapDumpOnly. Following is a table describing the four heap dump options. Additional
information on these three heap dump options is provided following 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>
BinarySIGQUIT-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.27.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
48 Diagnostic and Monitoring Tools and Options