Review of Memory analysis tools for analytical memory

Source: Internet
Author: User

Recently, because of system problems, memory analysis tools have been reviewed (for Eclipse)

Through the dump file, and then use the Memory Analysis tool on eclipse (it's easy to install online)

Memory Leak lookup Idea one:

Open "Details" under Leak Suspects->problem suspect N.

After you open this page, there are several things:

1, the reference cumulative relationship (shortest paths to the accumulation point)

2, storage objects (accumulated objects)

3, the storage object belongs to the class name (accumulated objects by Class)

This approach is simple and intuitive, knowing those objects to look for classes and reference points.

Memory leak Find Ideas two:

1, open the histogram (histogram), filter to find their own class, and then right-click on this record "list objects" under the Select "With incoming references"

Get to be those objects that reference this class.

2, then choose a right key from these object records "Path to GC Roots"-> "exclude weak references", get the hierarchical reference relationship, you know point.

If you are familiar with the code, you can guess that the class will cause a leak, you can use this method

Note: shallow vs. retained Heap

Shallow heap is the memory consumed by one object. An object needs/depending on the OS architecture/reference, 4 bytes per Integer, 8 bytes per Long, etc . Depending on the heap dump format the size is adjusted (e.g. aligned to 8, etc ...) to model better the real Consumptio N of the VM.

retained set of X is the set of objects which would being removed by GC where X is garbage collected.

retained heap of X is the sum of shallow sizes of all objects on retained set of X, i.e. memory kept by X.

For more detailed information can refer to help and online information.

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.