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

前端 未结 2 1025
无人共我
无人共我 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.

提交回复
热议问题