Phantom reference
Encyclopedia
A 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
.
An object is phantomly referenced after it has been finalized
, but before its allocated memory has been reclaimed.
Strong reference
In computer programming, a strong reference is a normal reference that protects the referred object from collection by a garbage collector. The term is used to distinguish the reference from weak references.a Category:Programming constructs...
' reference defined in the Java programming language
Java (programming language)
Java is a programming language originally developed by James Gosling at Sun Microsystems and released in 1995 as a core component of Sun Microsystems' Java platform. The language derives much of its syntax from C and C++ but has a simpler object model and fewer low-level facilities...
; the others being weak
Weak reference
In computer programming, a weak reference is a reference that does not protect the referenced object from collection by a garbage collector . An object referenced only by weak references is considered unreachable and so may be collected at any time...
and soft
Soft reference
A soft reference is one of the strengths or levels of 'non strong' reference defined in the Java programming language, the others being weak and phantom....
.
An object is phantomly referenced after it has been finalized
Finalizer
In object-oriented programming languages that use garbage collection, a finalizer is a special method that is executed when an object is garbage collected. It is similar in function to a destructor...
, but before its allocated memory has been reclaimed.