As memory is allocated, large blocks tend to be cut up into smaller ones. If the small blocks are never combined back into larger blocks, the average block size decreases over time, and it can be impossible to allocate a large block, even though enough total memory is available. That phenomenon is called fragmentation.

A garbage collector can avoid that by compactifying and relocating. Compactification is the process of moving the used blocks next to one another, which leaves behind one large block of free memory. But the movement of the used blocks forces pointers to be changed (to point to the new locations), a process called relocation.