In contiguous allocation each process occupies one unbroken block of memory. With fixed partitions memory is divided into partitions of preset sizes and each holds at most one process; the unused part of a partition is internal fragmentation. With variable partitions a process gets exactly the memory it asks for, so there is no internal fragmentation, but as processes finish the free memory breaks into scattered holes. Total free memory may be enough for a request while no single hole is: this is external fragmentation.
Compaction shifts the allocated blocks together so that all free memory becomes one hole. It removes external fragmentation but is possible only with execution-time binding, because processes change address. Paging avoids external fragmentation altogether.
Trace for variable partitions. Free holes in address order are 150, 450, 250, 350 and 600 KB. Requests arrive in the order 200, 400, 120 and 480 KB, and the holes left over after each allocation stay in place. For best fit and worst fit, ties are broken by the lower address (none occur in this trace). The table shows the hole chosen for each request.