The heap is divided into two spaces:
- The new space.
- The tenured space.
The new space is further divided into two zones:
- Allocate space.
- Survivor space.
Initially, the survivor space is completely empty. A new object is always created in the allocate space.
If when creating a new object an allocation failure takes place in the allocate space, a minor GC called scavenge is started. Scavenge works as follows.