Heap Dump Location for JBoss Using -XX: HeapDumpOnOutOfMemoryError
In JBoss, adding the -XX: HeapDumpOnOutOfMemoryError parameter to your JVM startup options enables the capturing of a heap dump upon an out of memory error. However, it is crucial to determine where this data is stored.
According to Oracle's documentation, the heap dump is created in a file named java_pid.hprof by default. This file is placed in the VM's working directory, which is typically the directory from which your JBoss instance started.
For example, if you start JBoss with this command:
/opt/jboss-6.1.0.Final/bin/standalone.sh
The heap dump will be located at:
/opt/jboss-6.1.0.Final/bin/java_<em>pid</em>.hprof
where pid is the process ID of the JBoss server.
However, you can specify an alternative location for the heap dump file using the -XX:HeapDumpPath= option. If you wish to store the heap dump in a directory named dumps on disk2, use the following parameter:
-XX:HeapDumpPath=/disk2/dumps
This will direct the creation of the heap dump file to the /disk2/dumps directory.
The above is the detailed content of Where Does JBoss Store Heap Dumps When Using -XX: HeapDumpOnOutOfMemoryError?. For more information, please follow other related articles on the PHP Chinese website!