“孤岛"垃圾收集

quot;Island of isolationquot; of Garbage Collection(“孤岛垃圾收集)
本文介绍了“孤岛"垃圾收集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

谁能解释一下垃圾收集的孤立岛的概念吗?

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

推荐答案

对象 A 引用对象 B.对象 B 引用对象 A.对象 A 和对象 B 都没有被任何其他对象引用.那是一座孤岛.

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.

从评论

class A {
   B myB; 
} 
class B { 
   A myA; 
} 

/* later */  
A a = new A(); 
B b = new B();  
a.b = b; 
b.a = a;

这篇关于“孤岛"垃圾收集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

How can create a producer using Spring Cloud Kafka Stream 3.1(如何使用Spring Cloud Kafka Stream 3.1创建制片人)
Insert a position in a linked list Java(在链接列表中插入位置Java)
Did I write this constructor properly?(我是否正确地编写了这个构造函数?)
Head value set to null but tail value still gets displayed(Head值设置为空,但仍显示Tail值)
printing nodes from a singly-linked list(打印单链接列表中的节点)
Control namespace prefixes in web services?(控制Web服务中的命名空间前缀?)