Is it possible to specify where JVM's crash dumps go?

前端 未结 2 497
我在风中等你
我在风中等你 2020-12-14 21:00

We have a desktop application using JNI that occasionally causes the JVM to crash. Luckily the JVM produces a hs_err_pidXXXX.log file, which is quite useful in

相关标签:
2条回答
  • 2020-12-14 21:58

    Joonas,

    Although the HeapDumpPath works for the heap dump it is not the answer for your question. The heap dump and the jvm crash log are two separate things.

    To change the destination of the jvm crash log run java with this option:

    -XX:ErrorFile=/path/to/file.
    

    Path/to/file is the place you want the JVM crash log to output.

    0 讨论(0)
  • 2020-12-14 22:02

    By default the heap dump is created in a file called java_pidpid.hprof in the working directory of the VM. You can specify an alternative file name or directory with the -XX:HeapDumpPath= option. For example -XX:HeapDumpPath=/disk2/dumps will cause the heap dump to be generated in the /disk2/dumps directory.

    0 讨论(0)
提交回复
热议问题