WeakHashMap is not thread-safe

java.util.WeakHashMap can be used as in-memory cache, allowing keys to expire when they are weakly reachable. Unfortunately this class is not thread-safe. It’s entirely possible that un-synchronized invocation of the WeakHashMap.get(Object) method will result in infinite busy waiting loop starving all other threads.

Read More