Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Memory Analyzer (MAT) » GC Root Unfinalized(How do you find the real GC Root for unfinalized objects)
GC Root Unfinalized [message #534026] Mon, 17 May 2010 18:28 Go to next message
Gary Karasiuk is currently offline Gary KarasiukFriend
Messages: 12
Registered: July 2009
Junior Member
I am looking at a core dump that has thousands of Unfinalized objects.

I thought that the unfinalized state meant that the instance has a finalize() method, but that it is still a live object because some other reference is keeping it alive.

But when I try to find the "real" GC root, I can't find it. What does this unfinalized state really mean?

Re: GC Root Unfinalized [message #534236 is a reply to message #534026] Tue, 18 May 2010 12:53 Go to previous messageGo to next message
Krum Tsvetkov is currently offline Krum TsvetkovFriend
Messages: 164
Registered: July 2009
Senior Member
Hi,

The two GC root types FINALIZABLE and UNFINALIZED were added specifically for IBM system dumps to mark objects which have something to do with finalization. We did this because on some platforms either the finalizer queue or the finalyzer thread were not visible in the Java heap. The meaning should be:

FINALIZABLE - An object which is a queue awaiting its finalizer to be run

UNFINALIZED - An object which has a finalize method, but has not been finalized and is not yet on the finalizer queue

I guess that your problem to find what other paths from GC roots to your objects comes from the way the "paths from GC roots" command is implemented in MAT. After reaching a GC root the command will not search through it. This normally is an advantage as it provides only the most important part of the reference chains. If you however run the paths from GC roots on a root object, the tool will give you just the object itself.

What could help is to explore the references to the objects "list objects" -> "with incoming references" from the context menu. It is not as convenient as the path from GC roots, but could help in this special situation.

-Krum
Re: GC Root Unfinalized [message #534333 is a reply to message #534236] Tue, 18 May 2010 17:17 Go to previous messageGo to next message
Gary Karasiuk is currently offline Gary KarasiukFriend
Messages: 12
Registered: July 2009
Junior Member
Thanks Krum!

I would be helpful if MAT recognized this case, and displayed the real GC root(s).

There are lots of these unfinalized objects, for instance, all enums are unfinalized.

Personally I think enums should not even be on the unfinalized list, as they have an empty final finalizer() whose purpose is to ensure that enum's can not be finalized.
Re: GC Root Unfinalized [message #534430 is a reply to message #534333] Wed, 19 May 2010 07:47 Go to previous message
Krum Tsvetkov is currently offline Krum TsvetkovFriend
Messages: 164
Registered: July 2009
Senior Member
The suggestion to treat some root types specially seems reasonable. I opened a bug for this:
313475: Paths to GC roots should go certain root types
https://bugs.eclipse.org/bugs/show_bug.cgi?id=313475
Previous Topic:An out of memory error has occurred during parsing heap dump
Next Topic:java heap size is only 20MB, but memory usage is 1.7GB
Goto Forum:
  


Current Time: Fri Apr 26 13:46:04 GMT 2024

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

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

Back to the top