Phantom reference
A phantom reference is a kind of reference in Java, where the memory can be reclaimed. The phantom reference is one of the strengths or levels of 'non strong' reference defined in the Java programming language; the others being weak and soft.[1] Phantom reference are the weakest level of reference in Java; in order from strongest to weakest, they are: strong, soft, weak, phantom. An object is phantomly referenced after it has been finalized. In Java 8 and earlier versions, the reference needs to be cleared before the memory for a finalized referent can be reclaimed. A change in Java 9[2] will allow memory from a finalized referent to be reclaimable immediately. UsePhantom references are of limited use, primarily narrow technical uses.[3] First, it can be used instead of a See alsoReferences
|