1

In the slide deck 'ConcurrentCachingAtGoogle', there is mention JDK8's implementation of ConcurrentHashMap no longer using a segmented hash table.

I assume the "segments" are the top level partitioning that the old implementation used to do.

What does the new implementation do, and how does it perform relative to JDK7's, when it comes to growing the table?

Also, any insights into what factors (in addition to memory footprint of empty instances) drove the change would be most welcome.

assylias
  • 321,522
  • 82
  • 660
  • 783
Dilum Ranatunga
  • 13,254
  • 3
  • 41
  • 52
  • 2
    Have you read the source code? The class starts with 5 screenfuls of implementation "Overview". From my reading, it still uses the segmented locking approach. Memory footprint is (quoting the same Overview) "about the same or better than java.util.HashMap". – Marko Topolnik Apr 28 '14 at 19:23
  • I am specifically interested behavior as the table grows. You will note that that old implementation -- in addition to segmented locks -- stored (and grew) the table a segment at a time. The new implementation has just a single table, but also maintains a nextTable while the table in being grown. I understand that the change improves the structure's memory footprint. I am interested in other characteristics. – Dilum Ranatunga Apr 29 '14 at 19:30

0 Answers0