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;
这篇关于“孤岛"垃圾收集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:“孤岛"垃圾收集
基础教程推荐
- 大摇大摆的枚举 2022-01-01
- 如何在 JFrame 中覆盖 windowsClosing 事件 2022-01-01
- 不推荐使用 Api 注释的描述 2022-01-01
- Java 实例变量在两个语句中声明和初始化 2022-01-01
- 在 Java 中创建日期的正确方法是什么? 2022-01-01
- 如何在 Spring @Value 注解中正确指定默认值? 2022-01-01
- 验证是否调用了所有 getter 方法 2022-01-01
- 从 python 访问 JVM 2022-01-01
- 多个组件的复杂布局 2022-01-01
- Java Swing计时器未清除 2022-01-01
