WeakHashMap
WeakHashMap is one of the lesser known member of Map family. It is a special kind of hashtable based Map implementation which stores weak references to the keys. That means keys of this kind of data structure will be stored in a WeakReference . So Entry of the Map will be reclaimed by the garbage collector when its key object is no longer used. More precisely, the presence of a mapping for a given key will not prevent the key from being discarded by the garbage collector, that is, made finalizable, finalized, and then reclaimed. In HashMap , if reference of a key object no longer exist , corresponding Entry ( key – value pair ) will not be removed from Map . Garbage collector can not collect live objects . As long as Map object is live , all buckets or Entry are live . So they can not be collected by garbage collector . WeakHashMap us...