Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 369047

Summary: Tracking/Comparing heap dumps
Product: [Tools] MAT Reporter: Stefan Liebig <Stefan.Liebig>
Component: GUIAssignee: Andrew Johnson <andrew_johnson>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: andrew_johnson
Version: 1.1   
Target Milestone: 1.11.0   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Bug Depends on: 361631, 561460    
Bug Blocks:    
Attachments:
Description Flags
Dominator tree comparison report none

Description Stefan Liebig CLA 2012-01-19 04:37:52 EST
I am not quite sure if this is a reasonable request. May be there are other solutions to my problem. I am not that familiar with MAT. 

While searching for a memory leak I created several heap dumps and analyzed them (Dominator Tree). I found a lot of retained objects that simply stay with a fixed size. But others are varying in their size. And one object's size was constantly growing!
I would love to have the possibility to analyze the dominator trees of several heap dumps.
Comment 1 Andrew Johnson CLA 2012-01-19 11:48:50 EST
I started some work to allow tree comparisons in bug 361631 but this may not be useful yet. It seems to compare using the full IObject.getDisplayName which includes the address so won't be helpful across dumps. Grouping the dominator tree by class doesn't work as I thought, as the class name includes the address.
Comment 2 Stefan Liebig CLA 2012-01-20 01:08:16 EST
It seems that Netbeans 7.1 supports something similar: http://java.dzone.com/articles/comparing-heap-dumps-netbeans
Comment 3 Andrew Johnson CLA 2012-01-20 03:16:30 EST
The compare basket is the standard way to compare dumps, and by comparing histogram tables you get to see how the numbers of objects differs between dumps:
http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.mat.ui.help%2Ftasks%2Fcomparingdata.html
For version 1.2 I'm looking at comparing trees as well as tables. Currently the comparison works on the original format of the tree, so even if you regroup the dominator tree by class the comparison still takes the original format of an object tree. By launching the dominator tree from the search queries command line and issuing this command:
 dominator_tree  -groupby BY_CLASS
then the dominator tree is grouped by class which might make a better base for the comparisons.
Comment 4 Andrew Johnson CLA 2013-05-15 06:39:08 EDT
How well does comparing dominator tree by class work for you?
Comment 5 Andrew Johnson CLA 2020-03-26 04:46:10 EDT
I know this is a very old request, but I have just made some improvements. The snapshot builds https://www.eclipse.org/mat/snapshotBuilds.php now have some queries to compare dominator trees.

See Leak Identification > Compare Snapshots Leak Report

This uses deltas in retained sizes when dominator trees from two snapshots are compared.
Comment 6 Andrew Johnson CLA 2021-06-03 04:36:12 EDT
Created attachment 286513 [details]
Dominator tree comparison report

Example of how the Leak Suspects by Snapshot Comparison report generates a comparison of the two dominator trees
:
Comment 7 Andrew Johnson CLA 2021-06-03 04:38:19 EDT
I hope this is sufficient, if not then please open a new enhancement request.