Home > Java > javaTutorial > Where Does JBoss Store Heap Dumps When Using -XX: HeapDumpOnOutOfMemoryError?

Where Does JBoss Store Heap Dumps When Using -XX: HeapDumpOnOutOfMemoryError?

Mary-Kate Olsen
Release: 2024-11-10 03:06:02
Original
855 people have browsed it

Where Does JBoss Store Heap Dumps When Using -XX: HeapDumpOnOutOfMemoryError?

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
Copy after login

The heap dump will be located at:

/opt/jboss-6.1.0.Final/bin/java_<em>pid</em>.hprof
Copy after login

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
Copy after login

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!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template