Home >Java >javaTutorial >Where are JBoss heap dumps stored when using the `-XX: HeapDumpOnOutOfMemoryError` parameter?

Where are JBoss heap dumps stored when using the `-XX: HeapDumpOnOutOfMemoryError` parameter?

Barbara Streisand
Barbara StreisandOriginal
2024-11-20 00:48:03973browse

Where are JBoss heap dumps stored when using the  `-XX: HeapDumpOnOutOfMemoryError` parameter?

Destination of Heap Dumps with HeapDumpOnOutOfMemoryError Parameter in JBoss

To address the out-of-memory errors encountered in the application, the -XX: HeapDumpOnOutOfMemoryError parameter can be added to the JVM startup options in the JBoss startup script. However, it's crucial to understand where these heap dumps are stored.

Oracle's documentation states that by default, the heap dump is created in a file named java_pid.hprof in the working directory of the virtual machine. For example:

java_26234.hprof

This file is placed in the directory where the JVM process was started. However, you can specify an alternative file name or directory using the -XX:HeapDumpPath= option. For instance:

-XX:HeapDumpPath=/disk2/dumps

In this case, the heap dump will be generated in the /disk2/dumps directory. By explicitly specifying the path, you can ensure that the heap dump is stored in a location where it can be easily accessed and analyzed, regardless of whether you're logged into the console.

The above is the detailed content of Where are JBoss heap dumps stored when using the `-XX: HeapDumpOnOutOfMemoryError` parameter?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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