Home > Java > javaTutorial > body text

Where is the Heap Dump File Saved When Using -XX: HeapDumpOnOutOfMemoryError?

DDD
Release: 2024-11-10 15:47:02
Original
792 people have browsed it

Where is the Heap Dump File Saved When Using -XX: HeapDumpOnOutOfMemoryError?

Heap Dump File Location with HeapDumpOnOutOfMemoryError

The -XX: HeapDumpOnOutOfMemoryError parameter, when added to JBoss JVM startup options, facilitates the creation of a heap dump upon encountering an out-of-memory error. Understanding the location where this dump file is saved is crucial for troubleshooting purposes.

Oracle's documentation provides insights into this behavior:

"By default, the heap dump is created in a file called java_pid.hprof in the working directory of the VM."

This means that the heap dump file will be generated in the same directory where the Java Virtual Machine (JVM) is running. If no alternative path is specified, the dump will appear in the current working directory.

However, you have the option to customize the dump file's location using the -XX:HeapDumpPath= parameter. By providing an alternative file name or directory, you can direct the dump to a specific location on your system. For instance, the following setting will save the heap dump in the /disk2/dumps directory:

-XX:HeapDumpPath=/disk2/dumps
Copy after login

By modifying the HeapDumpPath parameter, you can ensure that heap dump files are created in a predefined location, making them easier to access and analyze during troubleshooting scenarios.

The above is the detailed content of Where is the Heap Dump File Saved 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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template