Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Island of isolation" of Garbage Collection

Could anyone please explain the concept of Island of isolation of Garbage Collection?

like image 240
Isabel Jinson Avatar asked Apr 27 '09 09:04

Isabel Jinson


People also ask

What is island of isolation in java?

What is island of isolation? When two objects 'a', and 'b' reference each other, and they are not referenced by any other object, it is known as island of isolation. It is a group of objects which reference each other but they are not referenced but other objects of other applications at all.

Does garbage collection happens in string constant pool?

Second, in fact the rules for garbage collecting objects in the string pool are the same as for other String objects: indeed all objects. They will be garbage collected if the GC finds them to be unreachable.

What are the methods of garbage collection?

3. Which of the following is a garbage collection technique? Explanation: A mark and sweep garbage collection consists of two phases, the mark phase and the sweep phase. I mark phase all the objects reachable by java threads, native handles and other root sources are marked alive and others are garbage.

What is garbage collection in java?

Java garbage collection is the process by which Java programs perform automatic memory management. Java programs compile to bytecode that can be run on a Java Virtual Machine, or JVM for short. When Java programs run on the JVM, objects are created on the heap, which is a portion of memory dedicated to the program.


1 Answers

Object A references object B. Object B references object A. Neither object A nor object B is referenced by any other object. That's an island of isolation.

Basically, an island of isolation is a group of objects that reference each other but they are not referenced by any active object in the application. Strictly speaking, even a single unreferenced object is an island of isolation too.

Edit from Comment:

class A {    B myB;  }  class B {     A myA;  }   /* later */   A a = new A();  B b = new B();   a.b = b;  b.a = a; 
like image 188
Tamas Czinege Avatar answered Sep 28 '22 01:09

Tamas Czinege