JDK8 ConcurrentHashMap gets huge map support

Doug Lea announces huge map support in the latest incarnation of ConcurrentHashMap to more effectively support more than a billion elements.

Finally acting on an old idea, I committed an update to ConcurrentHashMap (currently only the one in our jdk8 preview package, as jsr166e.ConcurrentHashMap8) that much more gracefully handles maps that are huge or have many keys with colliding hash codes. Internally, it uses tree-map-like structures to maintain bins containing more nodes than would be expected under ideal random key distributions over ideal numbers of bins.

It’s nice to see the huge map consideration get some real effort put into it. Mark Reinhold, I believe, talked about huge map 64-bit support as a possible feature in JDK8 onwards in one of the videos hosted by Adam Messinger. I don’t think Doug Lea’s efforts are related to that but rather his own ideas.

Leave a Reply