[英]Can Sun JDK generate core/heap dump files when JVM crashes?
Is there anyway to generate core/heap dump file when JVM crashes? JVM 崩溃时是否有生成核心/堆转储文件的方法? Since these files are usually very helpful to find out bugs in code.由于这些文件通常非常有助于找出代码中的错误。
With the following JVM options:使用以下 JVM 选项:
-XX:+HeapDumpOnOutOfMemoryError
-XX:HeapDumpPath="/tmp"
JVM will dump the content of heap to a file in specified directory. JVM 会将堆的内容转储到指定目录中的文件中。 Note that this only happens when OutOfMemoryError
is thrown since dump isn't really needed if JVM crashed due to a different reason.请注意,这仅在OutOfMemoryError
时发生,因为如果 JVM 由于其他原因崩溃,则实际上并不需要转储。
Edit: "Boolean options are turned on with -XX:+ and turned off with -XX:-."编辑:“布尔选项用 -XX:+ 打开,用 -XX:- 关闭。” docs 文档
您可以使用-XX:HeapDump
JVM options 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.