Re:JVM Anatomy Quarks
by xxs on Friday January 31, 2020 @11:09AM
(#22202757)
Sync on a string is a bad to boot.
It's hard to explain how terrible the idea to synchronize/lock objects you don't control.
As for interning (not for strings only and not guaranteed) I have a lock free table (not CHM) that keeps most used objects (with possible random eviction) to provide a good trade off between unnecessary memory waste, fast access and low memory footprint.
It's hard to explain how terrible the idea to synchronize/lock objects you don't control.
As for interning (not for strings only and not guaranteed) I have a lock free table (not CHM) that keeps most used objects (with possible random eviction) to provide a good trade off between unnecessary memory waste, fast access and low memory footprint.