My solution about ordinary use is --> Whenever GC
thread runs, it will first identify all the objects for which there are no active reference present in the JVM. Suppose in the list of those objects, any particular object is used as a Key in WeakHashMap, the corresponding key-value pair will be removed from that WeakHashMap.
Please correct me if my understanding is not correct.