Can Sun JDK generate core / heap dump files when JVM crashes?

Is there a way to generate a kernel / heap dump file when a JVM crashes? Since these files are usually very useful for finding errors in the code. Any help is appreciated.

cheng

+6
source share
2 answers

With the following JVM options:

-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath="/tmp" 

The JVM will download the heap contents to a file in the specified directory. Note that this only happens when an OutOfMemoryError thrown, since a dump is not needed if the JVM crashed for another reason.

Edit: "Logical parameters are enabled with -XX: + and disabled with -XX: -." docs

+12
source

You can use the -XX:HeapDump JVM options .

+1
source

Source: https://habr.com/ru/post/917586/


All Articles