I am looking for a good hash map implementation. In particular, it is good for creating a large number of cards, most of which are small. So memory is a problem. It should be thread safe (although losing odd input can be a compromise of OK in exchange for better performance), and quickly for both receiving and input. And I would also like the moon on a stick, please, with a side order of justice.
Options I know:
HashMap It is amazingly safe to disable the stream.
ConcurrentHashMap. My first choice, but it has a large amount of memory - about 2 thousand per instance.
Collections.sychronizedMap (HashMap). This works fine for me, but I'm sure there should be faster alternatives.
Trove or Colt - I think none of them are thread safe, but perhaps the code can be adapted to ensure thread safety.
Any others? Any advice on what hits when? Any really good new hash map algorithms that Java can use to implement?
Thank you in advance for your entry!
java hashmap multithreading
Daniel Winterstein
source share