Is there anyway to generate core/heap dump file when JVM crashes? Since these files are usually very helpful to find out bugs in code.
When the JRockit JVM crashes, it generates a binary crash file ( . core or . mdmp ). By default, the binary crash file contains a copy of the entire JVM process.
JVM crash is one of the toughest problem professional Java developers face. In case of a JVM crash, the operating system creates a core dump file which is a memory snapshot of a running process. A core dump is created by the operating system when a fatal or unhandled error like signal or system exception occurs.
We generate java memory heap dump to identify issues like memory leaks and to optimize memory usage in our application.
With the following JVM options:
-XX:+HeapDumpOnOutOfMemoryError
-XX:HeapDumpPath="/tmp"
JVM will dump the content of heap to a file in specified directory. Note that this only happens when OutOfMemoryError
is thrown since dump isn't really needed if JVM crashed due to a different reason.
Edit: "Boolean options are turned on with -XX:+ and turned off with -XX:-." docs
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With