Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Memory Analyzer (MAT) » Exploring all GC roots in dump
Exploring all GC roots in dump [message #4202] Wed, 03 September 2008 13:02 Go to next message
Taras Tielkes is currently offline Taras Tielkes
Messages: 38
Registered: July 2009
Member
Is there an easy way in the MA tool to get a (grouped) list of all GC
roots in a snapshot? Grouped by root type (native, local, monitor, etc)?

Thanks,
-tt
Re: Exploring all GC roots in dump [message #4272 is a reply to message #4202] Wed, 03 September 2008 14:48 Go to previous messageGo to next message
Andreas Buchen is currently offline Andreas Buchen
Messages: 113
Registered: July 2009
Senior Member
> Is there an easy way in the MA tool to get a (grouped) list of all GC
> roots in a snapshot?

A little bit of ugly OQL will give you a list of all GC roots.

SELECT OBJECTS $snapshot.getGCRoots() FROM OBJECTS 0x0

> Grouped by root type (native, local, monitor, etc)?

But not grouped... (an object can be GC root for multiple reasons, maybe
because it is currently on the call stack of a running thread and it is a
system class). Sorry.
Re: Exploring all GC roots in dump [message #4342 is a reply to message #4272] Wed, 03 September 2008 15:17 Go to previous message
Taras Tielkes is currently offline Taras Tielkes
Messages: 38
Registered: July 2009
Member
Hi Andreas,

Thanks for the query, and indeed, I forgot that an object can belong to
multiple GC root categories.

YourKit proviews a view where I can explose the roots by group, I assume
in their UI an item would be shown in multiple groups, but I'm not sure.
I've used that UI sometimes to really explore things starting from some
specific roots.

-tt

Andreas Buchen wrote:
>> Is there an easy way in the MA tool to get a (grouped) list of all GC
>> roots in a snapshot?
>
> A little bit of ugly OQL will give you a list of all GC roots.
>
> SELECT OBJECTS $snapshot.getGCRoots() FROM OBJECTS 0x0
>
>> Grouped by root type (native, local, monitor, etc)?
>
> But not grouped... (an object can be GC root for multiple reasons, maybe
> because it is currently on the call stack of a running thread and it is
> a system class). Sorry.
>
Previous Topic:understanding size for jagged byte[][]
Next Topic:OQL Parser
Goto Forum:
  


Current Time: Fri Aug 01 06:05:47 EDT 2014

Powered by FUDForum. Page generated in 0.02645 seconds