简体   繁体   English

JVM 崩溃时,Sun JDK 可以生成核心/堆转储文件吗?

[英]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.

相关问题 如何在IBM-JDK中jvm处于活动状态时生成核心转储文件 - How to generate core dump file when jvm is alive in IBM-JDK 如何分析JVM崩溃时生成的大型核心转储 - How to analyze a large core dump generated when JVM crashes 在没有JDK-SIGQUIT的情况下生成堆转储到应用程序? - Generate heap dump without JDK - SIGQUIT to application? 在未安装JDK且进程作为服务运行的情况下,如何从Windows上的Java 5获取JVM堆转储 - How can a get a JVM heap dump from Java 5 on Windows without a JDK installed and the process running as a service JVM堆转储分析指向sun.awt.windows.WToolkit? - JVM Heap Dump Analysis point to sun.awt.windows.WToolkit? 如何从核心转储文件中提取JVM堆转储? - How to extract JVM heap dump from core dump file? 在抛出OutOfMemoryError时将JVM设置为转储堆 - Set a JVM to dump heap when OutOfMemoryError is thrown 如何记录并生成正在运行的进程的JVM堆转储,直到完成 - how to record and generate JVM heap dump of running process till it completes Windows 7上的JVM核心转储文件在哪里? - Where are the JVM core dump files located on Windows 7? Sun JVM可以毫无问题地处理巨大的堆大小,以及如何处理? - Can Sun JVM handle gigantic heap sizes without problems, and how?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM