Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Memory Analyzer (MAT) » calculation of retained size for primitive arrays
calculation of retained size for primitive arrays [message #5031] Tue, 16 September 2008 22:01 Go to next message
Taras Tielkes is currently offline Taras Tielkes
Messages: 38
Registered: July 2009
Member
Just a small nitpick..

I've noticed that calculation of retained sizes of (single-dimensional)
primitive arrays sometimes takes a few seconds to complete.

I'd expect it to be instant, the retained size will always equal the
shallow size. In addition, invoking approx. retained size for a set of
object could simply give the exact retained size for the subset of
objects that are primitive arrays.

Regards,
-tt
Re: calculation of retained size for primitive arrays [message #5166 is a reply to message #5031] Wed, 17 September 2008 19:39 Go to previous message
Andreas Buchen is currently offline Andreas Buchen
Messages: 113
Registered: July 2009
Senior Member
> I've noticed that calculation of retained sizes of (single-dimensional)
> primitive arrays sometimes takes a few seconds to complete.

Can you give a little more details? The retained size of each and every
object is pre-calculated during the parsing. It is stored in one of the
separate index files. Primitive arrays are not handled differently. The
index is not kept in memory (in fact, it would be too big) but read page
by page. So only loading a page should make a noticeable difference.

> I'd expect it to be instant, the retained size will always equal the
> shallow size. In addition, invoking approx. retained size for a set of
> object could simply give the exact retained size for the subset of
> objects that are primitive arrays.

Now, if you select multiple objects, the retained size needs to be
calculated. Either by doing a "mark-and-sweep" (precise) or by looking up
the object in the dominator tree and summing up unique sub-trees
(approximation). Indeed, if the object only contains primitive arrays,
summing up the individual sizes gives the correct result.

Let me put some more thoughts into this. Currently, the algorithm only
gets a bunch of objects ids (in fact, it is an int array) and hence cannot
easily take that shortcut. But the information is there. Thanks for the
idea!

Andreas.
Previous Topic:Dumping a running process
Next Topic:Announcement: IBM DTFJ adapter for Memory Analyzer Tool
Goto Forum:
  


Current Time: Thu Oct 02 06:39:15 GMT 2014

Powered by FUDForum. Page generated in 0.09338 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software