Java Reference Types
To reimburse different needs for references, Java provisioned different level of references type since
It actually meets some application requirement like caches.
The normal reference, unable to GC until no reference exists.
When memory about to overflow, good for saving memory when space sensitive.
Will be collected at next GC cycle. Designed for objects that have short life.
weakest reference. As if there is no reference.
Phantom references are most often used for scheduling pre-mortem cleanup actions in a more flexible way than is possible with the Java finalization mechanism.
04 April 2016