Use mat to compare multiple heap dump files
When debugging memory leaks, it is sometimes useful to compare 2 or more heap dump files in a timely manner. You need to generate multiple separate hprof files.
Here are some things about how to compare multiple heap dumps in a mat (a little more complex):
1. First hprof file (Usingfile > Open Heap Dump).
2. Open histogram view.
Watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqvc29kaw5v/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/dissolve/70 /gravity/southeast "/>
Figure 1. Histogram Viewbutton
3. In Navigationhistory view (if you can't see it from Window > Navigation history), right-click Histogram and select Add to Compare basket.
4. Open a second hprof file and redo steps 2 and 3.
5. Switch to compare basket view and click Compare the Results (the red "!" in the upper right corner of the view!) icon).
Figure 2. Control analysis Results
As above, in the results diagram. Objects #1所代表的weak. Create.hprof a weakreferencesactivity more than the Main.hporf represented by Objects#0. Objects #2更是多出10000个WFObject对象出来. The results are very obvious.
This article belongs to Sodino original. Posted in Blog:Http://blog.csdn.net/sodino, reprint please indicate the source.
The relevant code can be downloaded from the group file in QQ Group Code2share (363267446).
[Mat] Use mat to compare multiple heap dump files