Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
371 views
in Technique[技术] by (71.8m points)

java - "Island of isolation" of Garbage Collection

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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;

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...