Fixed vs Dynamic Partitioning
- Process Management
- Memory Management
- Deadlocks
- OS Introduction & Fundamentals
- CPU Scheduling Algorithms
- Threads & Concurrency
- Inter-Process Communication (IPC)
- Process Synchronization
- Virtual Memory & Paging
- File Systems
- Disk Scheduling
- I/O Management
Fixed Partitioning: Memory Divided Into Set Sizes Upfront
Physical Memory divided in advance into fixed-size partitions:
+----------+----------+----------+----------+
| 100k | 100k | 100k | 100k |
+----------+----------+----------+----------+Fixed partitioning divides memory into a set number of partitions, decided in advance, before any process is loaded. Each process is placed into a partition large enough to hold it - simple to implement, but the partition sizes are set upfront and cannot easily be changed afterward.
The Waste Problem With Fixed Partitions
A small process placed into a large, fixed-size partition wastes all the unused space inside that partition - this specific kind of waste is exactly what's called internal fragmentation, covered in detail in the next note.
Dynamic Partitioning: Sized Exactly to Fit Each Process
Physical Memory, dynamically sized to fit exactly:
+--------+------------+----------+---------+
| OS | Process A | Process B| (free) |
+--------+------------+----------+---------+
(partition sizes exactly match each process's actual needs)Dynamic partitioning creates a partition of exactly the size a process actually needs, at the moment it's loaded - no wasted space within any single partition, since each block precisely matches its process's real requirement.
The Trade-off Dynamic Partitioning Introduces Instead
As processes of varying sizes are repeatedly loaded and later removed, the free memory between remaining processes becomes broken up into many small, scattered gaps - this different kind of waste is external fragmentation, also covered in detail in the next note.
Comparing the Two Approaches
| Fixed Partitioning | Dynamic Partitioning | |
|---|---|---|
| Partition sizes | Set in advance, unchanging | Sized exactly to fit each process |
| Main waste type | Internal fragmentation | External fragmentation |
| Implementation complexity | Simpler | More complex - must track variable-sized free gaps |