Course contentsShow
← Java
Lesson 1014 of 2,87024. List ImplementationsFree lesson

The Growth Strategy: Multiplying Capacity by 1.5

How ArrayList calculates the new capacity—typically 50% larger than the current capacity.

The Growth Strategy: Multiplying Capacity by 1.5

What you'll learn: How ArrayList calculates the new capacity when it needs to grow—typically increasing by 50% each time.

Why Not Just Add One Slot?

When an ArrayList runs out of room and must resize, it doesn't just add space for one more element. That would be terribly inefficient—imagine needing to reallocate and copy the entire array every single time you add an element! Instead, Java uses a smarter growth strategy.

The 1.5× Rule

When ArrayList triggers a resize, it typically calculates the new capacity as 1.5 times the current capacity (or approximately 50% larger). This is often expressed as:

newCapacity = oldCapacity + (oldCapacity >> 1)

The bit-shift operation >> 1 divides the old capacity by 2, so you're adding half of the current size to itself.

Growth Example

  • Start with capacity: 10
  • First resize: 10 + 5 = 15
  • Next resize: 15 + 7 = 22
  • Next resize: 22 + 11 = 33

Why 1.5×?

This growth factor balances two concerns:

  1. Avoid frequent reallocations – Growing too slowly (like by a fixed amount) means resizing often as the list grows large.
  2. Avoid wasting memory – Doubling capacity (2×) can waste significant space, especially for large lists.

The 1.5× factor provides exponential growth to minimize reallocations while keeping memory overhead reasonable.

Key Takeaway: ArrayList grows its capacity by approximately 50% each time it resizes, using a 1.5× multiplier to balance performance and memory efficiency.