本文介绍了错误开扩HPROF文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图打开HPROF文件时得到以下异常(通过创建 Debug.dumpHprofData )与内存分析器:

I am getting the following exception when trying to open HPROF file (created by Debug.dumpHprofData) with Memory Analyzer:

java.io.IOException: Unknown HPROF Version (JAVA PROFILE 1.0.3)
at org.eclipse.mat.hprof.AbstractParser.readVersion(AbstractParser.java:124)
at org.eclipse.mat.hprof.Pass1Parser.read(Pass1Parser.java:69)
at org.eclipse.mat.hprof.HprofIndexBuilder.fill(HprofIndexBuilder.java:65)
at org.eclipse.mat.parser.internal.SnapshotFactoryImpl.parse(SnapshotFactoryImpl.java:203)
at org.eclipse.mat.parser.internal.SnapshotFactoryImpl.openSnapshot(SnapshotFactoryImpl.java:114)
at org.eclipse.mat.snapshot.SnapshotFactory.openSnapshot(SnapshotFactory.java:143)
at org.eclipse.mat.snapshot.SnapshotFactory.openSnapshot(SnapshotFactory.java:123)
at org.eclipse.mat.ui.snapshot.ParseHeapDumpJob.run(ParseHeapDumpJob.java:56)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

我如何解决此问题?

How do I resolve this?

感谢

推荐答案

HPROF 文件,你从机器人获得了Android的特定格式。应该转换 HPROF 文件采取从Android操作系统为标准 HPROF 格式。为此,您可以使用 HPROF-CONV 工具,它位于 AndroidSDK /工具/ HPROF-CONV

The hprof file you get from Android has android specific format. You should convert hprof file take from Android OS into standard hprof format. For this you can use hprof-conv tool that is located at AndroidSDK/tools/hprof-conv.

例如:

hprof-conv android.hprof mat.hprof

然后打开mat.hprof在内存分析器。

And then open mat.hprof in Memory Analyzer.

编辑:HPROF-CONV可能位于 AndroidSDK /平台工具/ 在一些捆绑

hprof-conv might be located under AndroidSDK/platform-tools/ in some bundles.

这篇关于错误开扩HPROF文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-07 18:35