Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Memory Analyzer (MAT) » MAT enhancement: diff
MAT enhancement: diff [message #2478] Mon, 28 July 2008 15:10 Go to next message
Tom Eugelink is currently offline Tom Eugelink
Messages: 807
Registered: July 2009
Senior Member
I'm currently trying to figure out where a big memory leak is hiding. I
press a button and 1 out of 3 times my memory increases by 20MB, even
though is should not increase at all.

It would be a great help in this situation to be able to take a hprof file
before and one after, and get a list of classes that were added. A diff so
to speak. Then at least I could see what causes the 20MB and give me a
good starting point. Now it's educated guessing and poking.
Re: MAT enhancement: diff [message #2508 is a reply to message #2478] Tue, 29 July 2008 03:48 Go to previous messageGo to next message
Erwin Margewitsch is currently offline Erwin Margewitsch
Messages: 17
Registered: July 2009
Junior Member
Hi Tom,

well we already offer such a diff, although we want to improve this
functionality.

When you open the histogram view of a heapdump, try the rightmost icon in
the icon bar (compare to another heapdump). You can compare two heapdumps,
which should be already be opened. Since the compare functionality works
on the histogram (aggregating objects on class level), it should be almost
what you desire.

You can find the information 'How to get a heapdump' under
http://wiki.eclipse.org/index.php/MemoryAnalyzer#Getting_a_H eap_Dump

Kind regards, Erwin
Re: MAT enhancement: diff [message #2537 is a reply to message #2508] Fri, 01 August 2008 03:11 Go to previous messageGo to next message
Andreas Buchen is currently offline Andreas Buchen
Messages: 113
Registered: July 2009
Senior Member
Let me explain: The heap dump identifies objects by its object address.
But this object address is not stable. Whenever the Garbage Collector
moves an object (within the eden spaces, into the old generation, etc.),
the object is assigned a new object address. Therefore it is not possible
to say whether an object was just moved or whether one instance was
garbage collected and another one created.

Hence, the Memory Analyzer compares heap dumps on an aggregate level. This
is the histogram (objects group by classes) or the class loader histogram
(objects grouped by the name of the class loader).

BTW, profiling tools overcome this limitation by assigning unique object
ids during the profiling run. This, of course, is an overhead which might
be perfectly acceptable for debugging, but is usually not done in
production systems.
Re: MAT enhancement: diff [message #11127 is a reply to message #2508] Wed, 17 June 2009 12:26 Go to previous messageGo to next message
John Currier is currently offline John Currier
Messages: 1
Registered: July 2009
Junior Member
Being able to do diffs between snapshots is a great feature, but it's
hidden too well.

The "Basic Analysis" section of the welcome screen says:

"To compare two snapshots open a baseline snapshot and a later snapshot
and press the Show differences toolbar button, and select the baseline
snapshot to see the differences."

The only way I finally figured out that I had to open the histogram first
is from this topic. That detail needs to be added to the text.

Thanks for such a cool tool,
John
http://schemaspy.sourceforge.net
Re: MAT enhancement: diff [message #11132 is a reply to message #11127] Wed, 17 June 2009 14:16 Go to previous messageGo to next message
Andreas Buchen is currently offline Andreas Buchen
Messages: 113
Registered: July 2009
Senior Member
You have a point here... We plan to enhance the functionality. I guess we
should update the help text sooner. Thanks for the feedback.
Re: MAT enhancement: diff [message #531434 is a reply to message #11132] Tue, 04 May 2010 16:58 Go to previous messageGo to next message
Adam Spiers is currently offline Adam Spiers
Messages: 1
Registered: May 2010
Junior Member
I had exactly the same confusion as John encountered. It was only when I did a search and found this thread that I located the icon. Currently the welcome text reads:

"To compare two snapshots open a baseline snapshot and a later snapshot and press the Show differences toolbar button, and select the baseline snapshot to see the differences."

Would be great if you could improve this to avoid confusion for future users. Thanks!
Re: MAT enhancement: diff [message #532171 is a reply to message #2478] Fri, 07 May 2010 08:04 Go to previous message
Andrew Johnson is currently offline Andrew Johnson
Messages: 119
Registered: July 2009
Senior Member
I've updated the text to say:

To compare two snapshots open a baseline snapshot and a later snapshot and from the snapshot Class Histogram view press the
Compare to another Heap Dump
toolbar button, and select the baseline snapshot to see the differences. There is also a more general comparison view using the compare basket. Tables and trees are added to the compare basket from the Navigation History.


There isn't time at the moment to update the tutorials further.
Previous Topic:Eclipse Application to generate reports
Next Topic:Can't access to svn repo
Goto Forum:
  


Current Time: Sun Aug 31 04:39:13 EDT 2014

Powered by FUDForum. Page generated in 0.02770 seconds