The key point is that when the garbage collector runs, it may or may not free an object that is softly reachable.
关键之处在于,垃圾收集器在运行时可能会(也可能不会)释放软可及对象。
Weakly reachable: an object that is not strongly or softly reachable and can be accessed through a weak reference.
弱可及对象(weakly reachable):不是强可及对象也不是软可及对象,并且能够通过弱引用访问的对象。
After the trace, the collector identifies the softly reachable objects — these objects for which no strong references exist but soft references do.
在跟踪之后,垃圾收集器就识别软可及的对象——这些对象上除了软引用外,没有任何强引用。
应用推荐