Bug 271908 - histogram comparison view simple enhancements
Summary: histogram comparison view simple enhancements
Status: RESOLVED FIXED
Alias: None
Product: MAT
Classification: Tools
Component: GUI (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Erwin Margewitsch CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 298078
Blocks:
  Show dependency tree
 
Reported: 2009-04-10 13:24 EDT by Randall Theobald CLA
Modified: 2011-10-21 04:53 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Randall Theobald CLA 2009-04-10 13:24:17 EDT
I am a performance analyst with IBM. I've been using MAT for a few months now and would like to take a more active posture--so I'll be opening up some enhancement requests and bugs. FYI: I look at IBM Core dumps, so I use the DTFJ.

One of MAT's weakest areas is in leak analysis/dump comparison. 

While some major enhancements could be added to MAT to facilitate leak analysis better, here are some simple, easy requests that I have found very helpful with our in-house tools.

The only direct facility for comparing 2 heap dumps is the compare button on the Histogram. After clicking this button and selecting another dump, you are presented with a very functionally-limited view (oh, it'd be good if this actually popped open another tab with a name other than Histogram--maybe Delta Histogram or Histogram Diff or something). You are shown the class names, the deltas of the number of instances, and the deltas of the shallow bytes.

I have found that when chasing small leaks, that objects tend to clump--not according to the raw delta of the number of objects or bytes, but according to the ratio of the delta (new value/old value, with a special case for zero--perhaps just substituting one for zero). If new columns were added to this Histogram Diff of the Object Ratio and the Shallow Heap Ratio, making them sortable, this would add a good deal of value (for me at least) to this view. Other possible columns would be the raw numbers (new and old values for Objects or Shallow Heap), which is very useful in a variety of situations where just the delta isn't sufficient.

Also, if I could right click on the class names and use the normal 'List objects', etc., context menu items, that would be useful. A one-time warning would be needed to tell the user that the resulting set is not from the Histogram Diff, but from the original Histogram.
Comment 1 Erwin Margewitsch CLA 2009-04-14 10:54:28 EDT
These proposals are exactly what we intend to do ;-)

We want to replace the current compare functionality with a new Compare Editor.
This new Compare Editor will enable to compare multiple heap dumps, it will allow to provide special panes for comparing heapdumps.

In a first version which should be avaialble in May we want to provide a delta histogram pane which will also offer raw numbers, ratios/percentages, ... (all sortable). It will be possible to call inside the compare editor the standard functions and queries for a specific heap dump (which will open the existing HeapEditor).

I will update this message when the first version is available.

Further ideas are welcome.
Comment 2 Andrew Johnson CLA 2009-04-20 03:12:01 EDT
One thing I would like to see with the heap comparison is which classes exist in one dump, but not the other. This isn't currently shown as the histogram shows class instances, and if a class does not exist in a dump then it is just the same as if it existed but with zero instances.
Comment 3 Randall Theobald CLA 2009-04-20 09:08:16 EDT
One way to do this would be to have entries for the classes themselves. Could be a checkbox whether to show them or not. In our internal tool, we did this by prepending the class name with 'CC_'.
Comment 4 Krum Tsvetkov CLA 2009-12-17 09:34:28 EST
I have created issue 298078 with our current ideas about improving the compare features. I hope that if we implement these suggestions properly, they will solve most of the problems described here. You can comment in the other message.
Comment 5 Andrew Johnson CLA 2011-10-21 04:53:21 EDT
The comparison pane now does what you require.

Class Name                              | Objects #0 | Objects #1-#0 | Objects #1-#0 % | Shallow Heap #0 | Shallow Heap #1-#0 | Shallow Heap #1-#0 %
-----------------------------------------------------------------------------------------------------------------------------------------------------
                                        |            |               |                 |                 |                    |                     
java.util.LinkedList$Entry              |    506,076 |               |                 |      20,243,040 |                    |                     
java.lang.Double                        |    506,076 |      -506,047 |           -100% |      12,145,824 |        -12,144,896 |                -100%
char[]                                  |        586 |    +1,316,149 |       +224,599% |          64,272 |       +134,890,672 |            +209,875%
byte[]                                  |          8 |       +80,197 |     +1,002,462% |          25,280 |         +6,337,464 |             +25,069%
java.lang.String                        |        574 |    +1,432,104 |       +249,495% |          22,960 |        +68,745,584 |            +299,415%
java.lang.Object[]                      |        202 |      +329,859 |       +163,297% |          13,784 |        +29,821,936 |            +216,352%
java.lang.Class                         |        313 |       +42,027 |        +13,427% |           5,136 |         +5,414,384 |            +105,420%
java.lang.String[]                      |         28 |       +89,035 |       +317,982% |           3,064 |         +5,709,128 |            +186,329%
java.util.Hashtable$Entry               |         58 |       +47,805 |        +82,422% |           2,784 |         +2,677,544 |             +96,176%
java.util.HashMap$Entry[]               |         14 |       +51,041 |       +364,579% |           2,128 |        +14,761,688 |            +693,688%
int[]                                   |          3 |       +26,839 |       +894,633% |           1,648 |         +2,191,640 |            +132,988%
java.util.Hashtable$Entry[]             |          7 |        +7,241 |       +103,443% |           1,344 |         +1,633,360 |            +121,530%
java.util.Locale                        |         22 |          +103 |           +468% |           1,056 |             +5,944 |                +563%
java.util.HashMap                       |         12 |       +51,031 |       +425,258% |             768 |         +3,674,328 |            +478,428%
java.lang.ref.Finalizer$FinalizerThread |          5 |               |                 |             760 |                    |                     
java.net.URL                            |          7 |        +8,973 |       +128,186% |             728 |         +1,005,032 |            +138,054%
java.lang.ref.Reference$ReferenceHandler|          5 |               |                 |             720 |                    |                     
java.io.ObjectStreamField               |         12 |            +5 |            +42% |             672 |               +416 |                 +62%