“Island of isolation” of Garbage Collection

后端 未结 4 1952
太阳男子
太阳男子 2020-12-01 08:46

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

4条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-01 09:33

    The thing to keep in mind is that objects are only collected if they are referenced, either directly or indirectly, from a GC root object (threads, current local variables, static variables etc). If two (or more) objects reference each other, but are not referenced from a root, then they are eligible for garbage collection.

提交回复
热议问题