posted 19 years ago
"Can any body put the concept of island of isloation ..."
An "island of isolation" is just a fancy way of saying that one or more objects have no references to them from active parts of an application.
An object is eligible for garbage collection when you no longer have any active references to it. You might still have references to it, but if those references come from objects that have no active references to them, the object is still eligible for garbage collection. Continuing the same methodology as I used in that post, let's look at this example:
So, at line A, how many objects are eligible for garbage collection?
If we look at this using my pictures, we start with this:
Next, we set out t references...
At this point, nothing is eligible for garbage collection because t1 and t2 are both within scope and therefore still active. However, when we do this...
Note that each object still has a reference to it, but those references don't come from an "active" part of the application. There's no longer a way to access either of these objects - we have created an "island of isolation."
So, at point A, there are 2 objects available for garbage collection.
[ March 02, 2005: Message edited by: Corey McGlone ]