I am using a WeaekHashMap to implement a Cache. I am wondering if I am iterating over the keys of this map, and at the same time garbage collector is actively r
The WeakHashMap is weak on the keys not the values so it is not appropriate for a cache of values if you want to release space when the value is not being used. You might want to take a look at MapMaker from the google collections.