Mat无法打开转储文件

时间:2016-01-11 10:25:34

标签: eclipse jmap eclipse-mat jhat

我的jmap命令是sudo -u flume /usr/java/jdk1.8.0_60/bin/jmap -F -dump:format=b,file=heap.hprof pid, 但是eclips mat无法打开转储文件,并抛出异常。

java.lang.NullPointerException
    at org.eclipse.mat.hprof.HprofParserHandlerImpl.resolveClassHierarchy(HprofParserHandlerImpl.java:587)
    at org.eclipse.mat.hprof.Pass2Parser.readInstanceDump(Pass2Parser.java:205)
    at org.eclipse.mat.hprof.Pass2Parser.readDumpSegments(Pass2Parser.java:159)
    at org.eclipse.mat.hprof.Pass2Parser.read(Pass2Parser.java:89)
    at org.eclipse.mat.hprof.HprofIndexBuilder.fill(HprofIndexBuilder.java:94)
    at org.eclipse.mat.parser.internal.SnapshotFactoryImpl.parse(SnapshotFactoryImpl.java:222)
    at org.eclipse.mat.parser.internal.SnapshotFactoryImpl.openSnapshot(SnapshotFactoryImpl.java:126)
    at org.eclipse.mat.snapshot.SnapshotFactory.openSnapshot(SnapshotFactory.java:145)
    at org.eclipse.mat.ui.snapshot.ParseHeapDumpJob.run(ParseHeapDumpJob.java:83)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

这是我的环境。

java version "1.8.0_60"
Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)

Linux version 2.6.32-504.el6.x86_64

但是jhat可以正确分析它。

1 个答案:

答案 0 :(得分:1)

这似乎是Java 8的一个已知问题。请参阅Bug 471757Bug 476262。也没有修复。作为临时解决方法,我会尝试Yourkit。这需要花钱,但过去它对我来说效果很好,至少你可以得到一个免费的2周评估密钥,该密钥应该足够长,以解决你当前的问题。

相关问题