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