Provides the system's {@link ReferenceQueue} implementation as well as different forms of reference objects which impose special behavior on the garbage collector. The behavior depends on the type of {@link Reference} being used. Three different type of references exist, each being weaker than the preceding one: {@link SoftReference}, {@link WeakReference}, and {@link PhantomReference}. "Weakness" here means that less restrictions are being imposed on the garbage collector as to when it is allowed to actually garbage-collect the referenced object.

In order to use reference objects properly it is important to understand the different types of reachability that trigger their clearing and enqueueing. The following table lists these, from strongest to weakest. For each row, an object is said to have the reachability on the left side if (and only if) it fulfills all of the requirements on the right side. In all rows, consider the root set to be a set of references that are "resistant" to garbage collection (that is, running threads, method parameters, local variables, static fields and the like).

Strongly reachable | There exists at least one path from the root set to the object that does not traverse any instance of a {@link Reference} subclass.
Softly reachable | The object is not strongly reachable. There exists at least one path from the root set to the object that does traverse a {@link SoftReference} instance, but no {@link WeakReference} or {@link PhantomReference} instances.
Weakly reachable | The object is neither strongly nor softly reachable. There exists at least one path from the root set to the object that does traverse a {@link WeakReference} instance, but no {@link PhantomReference} instances.
Phantom-reachable | The object is neither strongly, softly nor weakly reachable. The object is referenced by a {@link PhantomReference} instance. The object has already been finalized.

@since Android 1.0