Run GC and finalization before memory snapshot

Questions about YourKit Java Profiler
Post Reply
Loïc LAMBERT
Posts: 17
Joined: Mon Jul 18, 2005 8:21 am

Run GC and finalization before memory snapshot

Post by Loïc LAMBERT »

Hi.

Running GC and finalization before a memory snapshot would be interesting when looking for a memory leak : it removes the objects that are not relevant.
It may be useful to get a smaller snapshot too.

Loïc
Vladimir Kondratyev
Posts: 1626
Joined: Tue Aug 10, 2004 7:52 pm

Post by Vladimir Kondratyev »

Running GC and finalization before a memory snapshot would be interesting when looking for a memory leak : it removes the objects that are not relevant.
profiler doesn't take in account objects that should be removed by GC (it performs garbage collection by itself).

Early versions of profiler did GC before capturing memory snapshot, but it caused _huge_ pauses sometime. That's why we have removed this "feature".

You can manually run GC from "Control Panel" if you wish.
Loïc LAMBERT
Posts: 17
Joined: Mon Jul 18, 2005 8:21 am

Post by Loïc LAMBERT »

When I tried the version 4.0.14, I had many objects that were referenced by the finalizer only.
With the version 4.5b628, I have found none. So I guess that the new version removes those objects (which is great :-)).

But, threre is one change from the 4.0 to the 4.5 that seems to me a major regression: in the instance view, the object ID is no more displayed for each object. It becomes very hard to follow objects when map, trees or cross-references are involved. Hard to known if its the same object as before or other instance from the same class.
It sure makes you spare some memory, but I think there should be an option for that, persisted in the UI preferences or a menu.
Putting it in a status bar or a tooltip is not enough because the idea is to compare the IDs of different objects in the same page.
The best would be some kind of hyperlink that goes back to the found instance, but that may be memory and CPU consuming!

Loïc
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Post by Anton Katilin »

To see the hash code of a selected object, you can use Ctrl+Q.
Loïc LAMBERT
Posts: 17
Joined: Mon Jul 18, 2005 8:21 am

Post by Loïc LAMBERT »

Yes, that's right, but you can't get a "global" vision of the object graph. If Class1 has a field of Class2 c2 and Class2 has a field of Class1 c1, you don't know if the c1 of an instance of Class2 is the same object or not as the c2 of Class1 (I you see what I mean...).

It just remain me of an article in a french research newspaper about representation of huge information (a few years ago). There were some guys working on that at the Xerox PARC (Palo Alto Research Center).
- hyperbolic tree : the researcher has since created his compagny (Inxight).
- some big tables that shows visually the contents of the rows (a progress bar) in tiny lines and magnifies the lines around the selection of the user. You can see completly a very large table. I can't remember the name of the project
- another idea was to show the values in a big panel with squares or rectangles. The surface of an element is proportional to the value. With a tree on the left and this representation in the right, you can easily navigate on the main areas of the tree. I can't remember the name of the project. I saw a FS manager like this, to find the big files and directories. Could be great for the "New Objects" or "All objects" views.

Loïc
Post Reply