Previous | Next | Trail Map | To 1.1 -- And Beyond! | A Preview of Things to Come

Weak References

Weak references allow a program to maintain a reference to an object that does not prevent the object from being considered for reclamation by the garbage collector. They also allow a program to be notified when the collector has determined that an object has become eligible for reclamation. Weak references are useful for building simple caches as well as caches that are flushed only when memory is low, for implementing mappings that do not prevent their keys (or values) from being reclaimed, and for scheduling post-mortem cleanup actions in a more flexible way than is possible with the Java finalization mechanism.


Previous | Next | Trail Map | To 1.1 -- And Beyond! | A Preview of Things to Come