Skip to content
Commitwise
Menu

Load factor

How full a hash map is allowed to get (entries divided by buckets) before it grows.

Definition

When the number of entries divided by the number of buckets passes the load factor, the map allocates a bigger bucket array and moves every entry. Java's HashMap uses 0.75 by default. A lower load factor means fewer collisions but more memory. Because resizing doubles the size, inserts stay O(1) on average.

In practice

A Java HashMap with 16 buckets resizes to 32 when the 13th entry is added (16 × 0.75 = 12).

Learn it in context

Lessons that use this term.

Related terms

Esc

Type to search the whole site.