Closed
Description
Juergen Hoeller opened SPR-16994 and commented
ConcurrentReferenceHashMap.entrySet()
tries to reuse a cached EntrySet
instance but stores it in a regular field which doesn't guarantee visibility to other threads. Operating against a volatile
field is the cleaner arrangement here.
Also, ConcurrentReferenceHashMap
does not implement isEmpty()
, relying on AbstractMap
's computation of the full size. This can be optimized by simply backing out once a non-empty hash segment has been found.
Affects: 4.3.18, 5.0.7
Issue Links:
- Memory leak in ConcurrentReferenceHashMap [SPR-11440] #16066 Memory leak in ConcurrentReferenceHashMap
- ConcurrentReferenceHashMap doesn't limit upper concurrency level [SPR-11720] #16342 ConcurrentReferenceHashMap doesn't limit upper concurrency level
- Inconsistent handling of null values through Java 8 accessors in ConcurrentReferenceHashMap [SPR-16584] #21126 Inconsistent handling of null values through Java 8 accessors in ConcurrentReferenceHashMap
Referenced from: commits 44b2657, ce0323f, 779cf8d
Backported to: 4.3.19