What is the difference between android and standard hprof file?

207 views Asked by At

Recently I am doing some researches on Android hprof file analysis. But the relevant documents seem to be less than I expected. I can only get standard binary format of hprof file in documents of Oracle.

In haha library (now called leakcanary), I saw some segments, such as Heap Summary and CPU Sampling , was omitted in parsing.

So I wonder where I can find detailed information about these differences between android and standard hprof file.

1

There are 1 answers

0
Pierre-Yves Ricau On BEST ANSWER

The differences are not documented anywhere. The haha library was a repackaging of heap dump parsers sources, LeakCanary now has its own heap analyzer.

If you look at the difference between https://bitbucket.org/vshor/mat/src/default/ and https://github.com/joebowbeer/andromat you'll see what was necessary to make early versions of HAHA work on Android. That's summarized in this commit: https://github.com/square/haha/commit/65138abda1fab0ea9c10b05e7bdbe1cf54d0041b

Shark, the new LeakCanary heap dump analyzer, works with both JVM heap dumps and Android heap dumps so you could look at the sources