简体   繁体   English

如何分析JVM崩溃时生成的大型核心转储

[英]How to analyze a large core dump generated when JVM crashes

My web application using Java one day crashed and generated a large core dump (5.5GB). 我的Web应用程序有一天使用Java崩溃并生成一个大型核心转储(5.5GB)。 I tried to use IBM Thread and Monitor Dump Analyzer for Java to analyze this core dump, but while reading the core dump, the console said: 我尝试使用IBM Thread and Monitor Dump Analyzer for Java来分析这个核心转储,但在读取核心转储时,控制台说:

Exception in thread "Thread-0" java.lang.OutOfMemoryError: Requested array size exceeds VM limit
at java.util.Arrays.copyOf(Arrays.java:3332)
at java.lang.AbstractStringBuilder.expandCapacity(AbstractStringBuilder.java:137)
at java.lang.AbstractStringBuilder.ensureCapacityInternal(AbstractStringBuilder.java:121)
at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:569)
at java.lang.StringBuffer.append(StringBuffer.java:369)
at java.io.BufferedReader.readLine(BufferedReader.java:370)
at java.io.BufferedReader.readLine(BufferedReader.java:389)
at com.ibm.jinwoo.thread.FileTask.processThreadDump(FileTask.java:1858)
at com.ibm.jinwoo.thread.FileTask$ActualTask.<init>(FileTask.java:215)
at com.ibm.jinwoo.thread.FileTask$1.construct(FileTask.java:1368)
at com.ibm.jinwoo.thread.ThreadHandler$1.run(ThreadHandler.java:31)
at java.lang.Thread.run(Thread.java:745)

It seems that the core file is too large to analyze with this tool. 似乎核心文件太大而无法使用此工具进行分析。 Increasing the heap size with the option -Xmx10g did not work. 使用选项-Xmx10g增加堆大小不起作用。

What tool can be used to analyze such large core file? 可以使用什么工具来分析这样的大型核心文件?


Updated 2016-08-17 13:07: I tried to use Eclipse MAT tool but I encountered an following error when I tried to read the dump file. 更新2016-08-17 13:07:我尝试使用Eclipse MAT工具,但是当我尝试读取转储文件时遇到以下错误。

Error opening heap dump 'jvm-core.13074'. Check the error log for further details.
Error opening heap dump 'jvm-core.13074'. Check the error log for further details.
Not a HPROF heap dump (java.io.IOException)
Not a HPROF heap dump

Do I need to do kind of pre-processing or something to make the dump file readable to Eclipse MAT tool? 我是否需要进行某种预处理或某些事情来使转储文件对Eclipse MAT工具可读?

I had great success with Eclipse MAT tool . 我在Eclipse MAT工具上取得了很大的成功。 You can also tweak its heap by changing .ini file in its installation folder as you would do in Eclipse. 您也可以通过更改其安装文件夹中的.ini文件来调整其堆,就像在Eclipse中一样。 But make sure you have enough RAM available on your PC before loading a heap dump. 但是在加载堆转储之前,请确保PC上有足够的RAM可用。

It seems that this core file is not for Java-related tools like Eclipse MAT tool or IBM Thread and Monitor Dump Analyzer for Java. 似乎这个核心文件不适用于Java相关工具,如Eclipse MAT工具或IBM Thread and Monitor Dump Analyzer for Java。 The tools for the core file are gdb or pmap , pstack . 核心文件的工具是gdbpmappstack I thought I can debug why application crashes JVM, but the core file seems to have little information about application-level things. 我以为我可以调试为什么应用程序崩溃JVM,但核心文件似乎没有关于应用程序级别事情的信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM