I use a ConcurrentHashMap (key: String, value: custom object) as one of my data structures. the map contains about 300,000 objects and will be updated frequently (about 20,000 put and 20,000 removes per minute).
It seems, that the whole program slow down after about 1 hour. Can somebody tell me if the ConcurrentHashMap is made for frequent modifications or if there is an alternative which is better for my requirements?
Thanks 🙂
I’ve used
ConcurrentHashMapin production with many writers/readers @ > 100,000 read/writes per minute. We’d let the system run for days but I never encountered any slowdown due toConcurrentHashMap.If your code is slowing down after an hour, the first thing I’d suspect is GC overhead due to a memory leak. If I were you I’d hookup jvisualvm to your app. and monitor the memory/CPU usage and go from there.