You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
com/google/api/client/util/ClassInfo.of uses a WeakHashMap in a synchronized block to cache references to ClassInfo. This method is called every time any subclass of GenericData is created. The resulting synchronization on the WeakHashMap is a source of significant contention in highly concurrent applications.
Further the use of WeakHashMap here doesn't actually do any memory cleanup.
The key is the Class
The Class is referenced as a field in ClassInfo
ClassInfo is stored as a strong reference in the value side of the WeakHashMap
As a result the weak keys will never be unreferenced and removed.
The text was updated successfully, but these errors were encountered:
com/google/api/client/util/ClassInfo.of uses a WeakHashMap in a synchronized block to cache references to ClassInfo. This method is called every time any subclass of GenericData is created. The resulting synchronization on the WeakHashMap is a source of significant contention in highly concurrent applications.
Further the use of WeakHashMap here doesn't actually do any memory cleanup.
As a result the weak keys will never be unreferenced and removed.
The text was updated successfully, but these errors were encountered: