[Mat] Use mat to compare multiple heap dump files

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.