error opening HPROF file: IOException: Unknown HPROF Version

AndroidMemory LeaksDump

Android Problem Overview

I am getting the following exception when trying to open HPROF file (created by Debug.dumpHprofData) with Memory Analyzer: Unknown HPROF Version (JAVA PROFILE 1.0.3)
at org.eclipse.mat.hprof.AbstractParser.readVersion(
at org.eclipse.mat.hprof.HprofIndexBuilder.fill(
at org.eclipse.mat.parser.internal.SnapshotFactoryImpl.parse(
at org.eclipse.mat.parser.internal.SnapshotFactoryImpl.openSnapshot(
at org.eclipse.mat.snapshot.SnapshotFactory.openSnapshot(
at org.eclipse.mat.snapshot.SnapshotFactory.openSnapshot(

How do I resolve this?

Android Solutions

Solution 1 - Android

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.

For example:

hprof-conv android.hprof mat.hprof

And then open mat.hprof in Memory Analyzer.

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

Solution 2 - Android

If you are using Eclipse, just change the following:

  1. Open Preferences (from the Window menu)
  2. Navigate to Android->DDMS
  3. Change the HPROF action to "Open in Eclipse"

Solution 3 - Android

hprof-conv tool location got changed.

It is now located at AndroidSDK/platform-tools/hprof-conv


All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionAsahiView Question on Stackoverflow
Solution 1 - AndroidinazarukView Answer on Stackoverflow
Solution 2 - AndroidApirak LunlaView Answer on Stackoverflow
Solution 3 - AndroidSumoanandView Answer on Stackoverflow