Partitioning
Fixed Partitions
One of the simplest allocation methods divides memory into fixed-size partitions, each holding one process. When a partition is free, a process no larger than the partition can be selected from the input queue. After termination, another process can use that partition.
Fixed partitions are simple and have low overhead, but their fixed sizes and count prevent programs larger than the largest partition from running and limit the number of active processes. Internal fragmentation reduces memory utilization.
Regardless of its size, a process occupies a whole partition. Unused space inside that partition cannot be used by another process: this is internal fragmentation.
Dynamic Partitions
When a new process needs memory, find a sufficiently large block and allocate the required space if one exists.
Three common approaches to dynamic storage allocation are:
- First-fit: start at the beginning of the list and allocate the first sufficiently large block.
- Best-fit: search the entire list and allocate the smallest sufficient block. This minimizes the immediate remainder, not necessarily long-term external fragmentation.
- Worst-fit: search the entire list and allocate the largest block, leaving the largest immediate remainder.
Dynamic partitioning allocates suitably sized regions and eliminates internal fragmentation in an ideal exact-allocation model, but creates external fragmentation. Loading and removing processes divides free memory into small pieces. External fragmentation occurs when total free space can satisfy a request but no sufficiently large contiguous region exists.
Compaction consolidates separate free partitions into a larger one. Moving relocatable processes to one end of memory brings free regions together at the other end.
Place, release, and compact
Unlock the complete interactive lab, deeper explanations, and curated reference answers.
KNOWLEDGE QUIZ
Compare placement and movement
Five holes are separated by occupied regions. Restart from this layout for each policy.
- Use first-fit, best-fit and worst-fit. For each request, record the hole ID, its size before allocation and the remainder; mark failures.
- From the original layout, can a 700-unit request succeed? Compare total free space and the largest hole, then show the layout after compaction.
- Distinguish coalescing, compaction and swapping. A 128-unit fixed partition holds 100 units: how much space is wasted inside it?
| Request | Hole ID | Before − request | Remainder |
|---|---|---|---|
| 212 | ? | ? | ? |
| 417 | ? | ? | ? |
| 112 | ? | ? | ? |
| 426 | ? | ? | ? |