A weak reference is one that does not prevent the referenced object from being garbage collected. You might use them to manage a HashMap to look up a cache of objects.

Using WeakHashMap to Avoid Memory Leaks

Using WeakHashMap for Listener Lists

O’Reilly: Java Performance and Tuning

Performance improvement on memory leak

Advertisements