wood burning stoves 2.0*
The moose likes Java in General and the fly likes GC Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "GC" Watch "GC" New topic
Author

GC

duhit Choudhary
Ranch Hand

Joined: Apr 01, 2012
Posts: 64
how can an isolated island of objects will become eligible for the Garbage Collection???
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18529
    
  40

duhit Choudhary wrote:how can an isolated island of objects will become eligible for the Garbage Collection???


Well, at a very high level, the GC starts at the roots -- which include static variables of loaded classes, local variables of all threads (that is still in scope), and some JVM caches too. It then traverses all the objects -- how is traverses is different depending of which GC is running.... regardless, at the end, whatever hasn't been traversed, is considered unreachable, and eligible for GC.

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: GC