Memory fragmentation occurs when allocation and reclamation leave usable memory split into separated regions. In a garbage-collected heap, dead objects can leave holes between live objects; those gaps waste space, reduce cache efficiency, and make allocation more expensive. section 9.2.3 section 9.3.1
The collector and allocator determine how fragmentation is controlled:
- V8 compacts sufficiently fragmented old-generation pages by moving live objects together and updating every pointer, but pauses JavaScript execution during the move. section 9.2.3
- JSC uses fixed-size cells in 16KB blocks and does not copy surviving young objects, so live cells can remain scattered among empty cells. section 9.3.1
- Non-moving collection simplifies native integration because C++ code can retain raw pointers, while moving collection requires pointer-updating handles. section 9.3.1
The partially empty block
A JSC block may contain live objects scattered among freed cells. Because the block is only partially empty, it cannot be reclaimed wholesale; the allocator must search free cells, while cache lines may carry dead space alongside live data. section 9.3.1


