我可以强制生成JVM崩溃日志文件吗?

时间:2022-04-07 17:20:23

The log file from a JVM crash contains all sorts of useful information for debugging, such as shared libraries loaded and the complete environment. Can I force the JVM to generate one of these programmatically; either by executing code that crashes it or some other way? Or alternatively access the same information another way?

来自JVM崩溃的日志文件包含用于调试的各种有用信息,例如加载的共享库和完整的环境。我可以强制JVM以编程方式生成其中一个;通过执行崩溃它的代码或其他方式?或者以另一种方式访问​​相同的信息?

3 个解决方案

#1


8  

You can try throwing an OutOfMemoryError and adding the -XX:+HeapDumpOnOutOfMemoryError jvm argument. This is new as of 1.6 as are the other tools suggested by McDowell. http://blogs.oracle.com/watt/resource/jvm-options-list.html

您可以尝试抛出OutOfMemoryError并添加-XX:+ HeapDumpOnOutOfMemoryError jvm参数。这是1.6的新功能,以及McDowell建议的其他工具。 http://blogs.oracle.com/watt/resource/jvm-options-list.html

#2


2  

Have a look at the JDK Development Tools, in particular the Troubleshooting Tools for dumping the heap, printing config info, etcetera.

查看JDK开发工具,特别是用于转储堆的故障排除工具,打印配置信息等。

#3


0  

I am pretty sure this can be done with the IBM JDK as I was playing around with their stack analyzer some time ago. One option to force the dump would just to cause an outOfMemoryException.

我很确定这可以通过IBM JDK完成,因为我之前正在使用他们的堆栈分析器。强制转储的一个选项只会导致outOfMemoryException。

These tools may provide some clues http://www.ibm.com/developerworks/java/library/j-ibmtools1/

这些工具可能会提供一些线索http://www.ibm.com/developerworks/java/library/j-ibmtools1/

#1


8  

You can try throwing an OutOfMemoryError and adding the -XX:+HeapDumpOnOutOfMemoryError jvm argument. This is new as of 1.6 as are the other tools suggested by McDowell. http://blogs.oracle.com/watt/resource/jvm-options-list.html

您可以尝试抛出OutOfMemoryError并添加-XX:+ HeapDumpOnOutOfMemoryError jvm参数。这是1.6的新功能,以及McDowell建议的其他工具。 http://blogs.oracle.com/watt/resource/jvm-options-list.html

#2


2  

Have a look at the JDK Development Tools, in particular the Troubleshooting Tools for dumping the heap, printing config info, etcetera.

查看JDK开发工具,特别是用于转储堆的故障排除工具,打印配置信息等。

#3


0  

I am pretty sure this can be done with the IBM JDK as I was playing around with their stack analyzer some time ago. One option to force the dump would just to cause an outOfMemoryException.

我很确定这可以通过IBM JDK完成,因为我之前正在使用他们的堆栈分析器。强制转储的一个选项只会导致outOfMemoryException。

These tools may provide some clues http://www.ibm.com/developerworks/java/library/j-ibmtools1/

这些工具可能会提供一些线索http://www.ibm.com/developerworks/java/library/j-ibmtools1/