Contiguous memory allocation
Holes, partitions and fragmentation, interactively.
Module 4
Session 4.2
Lesson 1 of 2
Contiguous Memory Allocation
First fit, best fit, worst fit, holes, and why compaction exists.
The model
Each process occupies one interval of RAM. Free memory is a list of holes. External fragmentation: holes too small to use. Internal fragmentation: unused bytes inside an allocated block.
- First fit — first hole that is large enough (fast).
- Best fit — smallest hole that is large enough (tiny leftover chips).
- Worst fit — largest hole (hope leftovers stay useful).