Java heap dump & shut down - what order?

前端 未结 5 1464
暖寄归人
暖寄归人 2021-02-07 08:35

I would like to detect an OutOfMemoryError, take a heap dump, and automatically exit the Java program. Say I have the following command-line arguments for my JVM:

5条回答
  •  不要未来只要你来
    2021-02-07 08:59

    I think this would heavily depend on the actual JVM implementation you are using. I'd like to believe that the JVM in use employs some intelligent ordering, first performing a heap dump than killing the machine. However, in my opinion you should not rely on the order of options.

提交回复
热议问题