在javaAPI文档
https://docs.oracle.com/javase/8/docs/api/java/lang/ref/package-summary.html
中介绍了Java.lang.ref,它提供了与 Java 垃圾回收器密切相关的引用类。
并且介绍了对象的可达性。
Reachability
Going from strongest to weakest, the different levels of reachability reflect the life cycle of an object. They are operationally defined as follows:
- An object is strongly reachable if it can be reached by some thread without traversing any reference objects. A newly-created object is strongly reachable by the thread that created it.
- An object is softly reachable if it is not strongly reachable but can be reached by traversing a soft reference.
- An object is weakly reachable if it is neither strongly nor softly reachable but can be reached by traversing a weak reference. When the weak references to a weakly-reachable object are