0

Some articles online have done a good job explaining how HashMap in Java 8 works internally and why the TREEIFY_THRESHOLD is set to 8. However, I haven't found a satisfying answer to this question: Why is UNTREEIFY_THRESHOLD 6 instead of other values such as 7? Could someone please help me with this?

    /**
     * The bin count threshold for untreeifying a (split) bin during a
     * resize operation. Should be less than TREEIFY_THRESHOLD, and at
     * most 6 to mesh with shrinkage detection under removal.
     */
    static final int UNTREEIFY_THRESHOLD = 6;
maxwellhertz
  • 403
  • 1
  • 6
  • 17

0 Answers0