Fully featured low overhead profiler for Java EE and Java SE platforms.
Performance monitoring and profiling of Jenkins, TeamCity, Gradle, Maven, Ant, JUnit and TestNG.
Easy to use performance and memory profiler for .NET framework.

incoming references aggregated view

Moderators: Vladimir Kondratyev, Anton Katilin

incoming references aggregated view

Postby grandinj » Thu Apr 21, 2005 7:42 am

Hi

I have tons of small objects which are referenced from various places.

What I want is a summarized view of incoming references.
ie. I want to know that object A is referenced by 50 copies of B and also by 1000 copies of object C.

A suggested display would look something like the "incoming references" view but with an additional column for "number of objects".

That would let me explore back along the reference path to see where the culprits are, without having to open tons of objects and make guesses.

Thanks.
grandinj
 
Posts: 4
Joined: Thu Apr 21, 2005 7:35 am

Postby Vladimir Kondratyev » Thu Apr 28, 2005 3:33 pm

Actually incoming/outcoming reference views are weak instrument to explore heap. If you are finding memory leak (why particular obect is not collected), try to find path to GC root.
Vladimir Kondratyev
 
Posts: 1519
Joined: Tue Aug 10, 2004 7:52 pm
Location: Düsseldorf, Germany

Postby grandinj » Thu Apr 28, 2005 3:47 pm

It's not a leak.

I'm profiling certain usages of Eclipse, and it generates enormous numbers of
small objects.

I need to know what percentages of objects linked to a central object are of each type, so I know where to focus my efforts.

This is not an isolated problem - I often run across this when attempting to optimize systems that have fine grained internal data models and/or large caches.

Normally I investigate 10-50 of the object references by hand to get a "feel" for which objects are causing the problem, but that gets very tiring, especially when it seems like something the computer could do for me quite easily.
grandinj
 
Posts: 4
Joined: Thu Apr 21, 2005 7:35 am

Postby Vladimir Kondratyev » Thu Apr 28, 2005 4:08 pm

OK. How will you use information that A is referenced by 50 copies of B and also by 1000 copies of object C? I'm asking because it's not clear to me how this information could be used for _optimization_.
Vladimir Kondratyev
 
Posts: 1519
Joined: Tue Aug 10, 2004 7:52 pm
Location: Düsseldorf, Germany

Postby grandinj » Thu Apr 28, 2005 4:34 pm

For example, I have an object A, which I can see in the "class list" view is occupying a lot of memory.

I switch to the "Instances of A" view, and select "Incoming References".
But because this object is held in a deeply nested structure I see lots of
"Group of 500 objects" in my list.

So I try using "find path from GC roots" and set the number very high, but then I get tons of results.

What I want is an aggregated "find path from GC roots" view, so that I know for sure where the bulk of the references are coming from.

I don't want to have to sample half a dozen individual objects and discover later on that the object is being referenced in more than one way and I chose the wrong ones to look at.

It is more a matter of "this object is referenced by 1000 copies of B and 50 copies of C. If I happen to get unlucky and look at the C references first, then I will be wasting time and optimizing the wrong thing".

But if I know the numbers for sure, I can proceed with confidence and pick B as my starting point for improving memory usage.

This gets particularly useful when trying to find where common objects like String/Integer/etc/char[]/byte[] are being held from.
grandinj
 
Posts: 4
Joined: Thu Apr 21, 2005 7:35 am

Postby grandinj » Thu Apr 28, 2005 4:38 pm

Maybe it would help if I said that this is not about finding a bug in the memory allocation, or finding a reference that should not be held.

The allocations are good, they are just potentially wasteful.

This is about getting an overall picture of the objects allocated so that I can reduce the number of objects (where possible) and reduce the size of the data structures holding information (where I can't drop the objects themselves) or reducing the caching (where the cost of recreating the objects is less than the cost of the memory).
grandinj
 
Posts: 4
Joined: Thu Apr 21, 2005 7:35 am

Postby chadm » Fri Apr 29, 2005 10:05 pm

It would be very valuable to view references agregated by class rather than individually by instance.

For example. If I see 10 instances of A and view incoming references to it I may see 10, 5, 20 instances of B. It would be handy if YourKit rendered it like this.


[5]B->[10]A

Indicating that there are 5 instances of B that collectively refer to 10 instances of A. A more complex example where this becomes very useful is:


[1]B->[100]A
[10]C->[10]A

I know immediatly that I can focus my attention on class B
chadm
 
Posts: 4
Joined: Wed Apr 27, 2005 6:31 pm


Return to Java Profiler

Who is online

Users browsing this forum: Google [Bot] and 1 guest

YourKit uses cookies and other tracking technologies to improve your browsing experience on our website, to show you personalized content and targeted ads, to analyze our website traffic, and to understand where our visitors are coming from.

By browsing our website, you consent to our use of cookies and other tracking technologies in accordance with the Privacy Policy.