Analyzer Tool (MAT) analyzes JVM memory leak cases

Source: Internet
Author: User

1, monitoring purposes

2. Common analysis Tools

3, Analysis case-mat
MAT Introduction and Analysis:
Start the mat and select the menu item File-open heap dump to load the heap dump file that needs to be parsed. After the file is loaded, you can see the interface shown in 1:

From Figure 1, you can see most of his features:
? Histogram can list objects in memory, number and size of objects
? Dominator Tree can list which threads and which objects the thread is executing occupy space
? Top consumers lists the largest object by graph
? Leak Suspects automatically analyzes the cause of leaks through MA.
Histogram 2:
Objects: Number of objects in a class
Shallow size: The size of the object itself occupies memory and does not contain references to other objects, that is, object headers plus member variables (not values of member variables) and sums. :
Retained size: Is the sum of the shallow size of the object's own shallow size+ accessed directly or indirectly from the object to the object. In other words, the retained size is the sum of the memory that the object can be recycled to after it has been GC.

As you can see from Figure 2, the objects of the Java.util.HashMap class occupy a lot of space.

Dominator Tree 3:
As you can see from Figure 3, Com.csii.ibs.lc.ClusterOnlineUserRegistry takes up a lot of memory space

Top comsumers 4:
Shows what the largest objects in memory are, what their corresponding classes are, and what class loaders are classloader. There are times where we can see where the code leaks.

4. A case:
Today's online business JVM monitors for memory leaks

Select Path to GC Roots->exclude weak references, filter

Then it's very intuitive to analyze what's causing it and then optimize it.

Analyzer Tool (MAT) analyzes JVM memory leak cases

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.