Using -XX:HeapDumpPath option but want to integrate the process id

前端 未结 2 1013
无人共我
无人共我 2021-01-01 16:09

When using -XX:+HeapDumpOnOutOfMemoryError the JVM will not overwrite the heap dump if there is already a dump file under the specified path. I want to be able

相关标签:
2条回答
  • 2021-01-01 16:34

    You should add which Java you use. These options depends on the JVM vendor (IBM, Oracle, etc.)

    OnOutOfMemoryError says WHEN to perform the dump. HeapDumpPath says WHERE to put the dump. I think the use of HeapDumpPath turns on the first, but I advice to use both for clarity.

    About the original question, use the pid in the dump file name is a good practice. It can help in particular to corolate and analyse what happens after multiple issues/restarts.

    The exact syntax is explained here.

    0 讨论(0)
  • 2021-01-01 16:41

    That can be a path to a file OR directory. If you have a path to a directory, the generated file name will have pid in it by default.

    http://www.oracle.com/technetwork/java/javase/tech/vmoptions-jsp-140102.html

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