如果一个对象惟一剩下的引用是弱引用或软引用,那么该对象是软可及的(softly reachable)。垃圾收集器并不像其收集弱可及的对象一样尽量地收集软可及的对象,相反,它只在真正 “需要” 内存时才收集软可及的对象。
基于20个网页-相关网页
在跟踪之后,垃圾收集器就识别软可及的对象——这些对象上除了软引用外,没有任何强引用。
After the trace, the collector identifies the softly reachable objects — these objects for which no strong references exist but soft references do.
处理软引用之后,弱可及对象的集合被识别——这样的对象上不存在强引用或软引用。
After processing the soft references, the set of weakly reachable objects is identified — objects for which no strong or soft references exist.
弱可及对象(weakly reachable):不是强可及对象也不是软可及对象,并且能够通过弱引用访问的对象。
Weakly reachable: an object that is not strongly or softly reachable and can be accessed through a weak reference.
应用推荐