Fixed vs Dynamic Partitioning

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 PartitioningDynamic Partitioning
Partition sizesSet in advance, unchangingSized exactly to fit each process
Main waste typeInternal fragmentationExternal fragmentation
Implementation complexitySimplerMore complex - must track variable-sized free gaps
Written by Lorens Mishra

Software Engineer Notes Management System Administrator

Discussion

0 comments
Sign in to join the discussion.

No comments yet. Be the first to say something.