Fixed Partition vs Variable Partition in Operating Systems, and the Need for Compaction
In memory partitioning, the operating system assigns each process to a contiguous region of RAM. Two classic contiguous allocation methods are fixed partitioning and variable partitioning. The essential difference is that fixed partitioning creates partitions in advance, while variable partitioning creates them on demand to better match process sizes.2
In fixed partitioning, main memory is split into a fixed number of partitions, each capable of holding at most one process. A process must fit entirely inside one available partition of equal or greater size. In variable partitioning, partitions are not predetermined; instead, the OS allocates a block approximately equal to the process's size when the process arrives, improving utilization.2
The trade-off is fragmentation. Fixed partitioning commonly suffers from internal fragmentation, because a process may be smaller than the partition assigned to it.2 Variable partitioning largely removes internal waste, but over time creates external fragmentation, where total free space may be sufficient yet no single contiguous block is large enough for a new process.2 This leads directly to the need for compaction, a technique that merges dispersed free holes into one larger usable region.2
Footnotes
-
Difference between Fixed Partitioning and Variable Partitioning - GeeksforGeeks - Overview of definitions, features, and comparison. ↩ ↩2
-
CSC 553 Operating Systems - Lecture 7 - Memory Management - Lecture notes explaining dynamic partitioning, compaction, and relocation cost. ↩ ↩2
-
Memory Management in Operating System - GeeksforGeeks - Summary of partitioned memory allocation and fixed partition characteristics. ↩ ↩2
-
Variable (or Dynamic) Partitioning in Operating System - GeeksforGeeks - Explanation of dynamic partitioning and its motivation. ↩ ↩2
-
Difference between Internal and External Fragmentation - GeeksforGeeks - Clarifies internal vs external fragmentation and the role of compaction. ↩ ↩2
-
Implementation of Contiguous Memory Management Techniques - GeeksforGeeks - Discusses fixed/variable partition schemes, placement algorithms, and fragmentation handling. ↩
Memory Partitioning Explained: Fixed vs Variable Techniques for Beginners
Core Distinction
Fixed partitioning decides partition boundaries before processes run, while variable partitioning creates boundaries as processes arrive.2
Footnotes
-
Difference between Fixed Partitioning and Variable Partitioning - GeeksforGeeks - Overview of definitions, features, and comparison. ↩
-
Memory Management in Operating System - GeeksforGeeks - Summary of partitioned memory allocation and fixed partition characteristics. ↩
Fixed Partitioning
In fixed partitioning, memory is divided into a predetermined number of static partitions during system setup or initialization.2 These partitions may be equal-sized or unequal-sized, but their count and boundaries do not change during execution. Since each partition holds only one process, the degree of multiprogramming is limited by the number of partitions.2
The chief advantage of this scheme is simplicity. The OS bookkeeping is relatively small, allocation is straightforward, and implementation overhead is low.2 However, it wastes memory when process sizes do not match partition sizes. If a process is placed into a partition, the unused inside that partition is lost to internal fragmentation.2
A second limitation is process size restriction. If the largest partition is smaller than a process, that process cannot be loaded at all, even if total free memory across partitions is sufficient.2 Thus, fixed partitioning is simple but inflexible.
| Aspect | Fixed Partitioning |
|---|---|
| Partition creation | Predefined before execution |
| Partition size | Fixed |
| Allocation style | One process per partition |
| Main waste pattern | Internal fragmentation |
| Multiprogramming limit | Number of partitions |
| Implementation | Easy |
Footnotes
-
Difference between Fixed Partitioning and Variable Partitioning - GeeksforGeeks - Overview of definitions, features, and comparison. ↩
-
Memory Management in Operating System - GeeksforGeeks - Summary of partitioned memory allocation and fixed partition characteristics. ↩ ↩2 ↩3 ↩4 ↩5 ↩6
-
Implementation of Contiguous Memory Management Techniques - GeeksforGeeks - Discusses fixed/variable partition schemes, placement algorithms, and fragmentation handling. ↩ ↩2 ↩3
-
Difference between Internal and External Fragmentation - GeeksforGeeks - Clarifies internal vs external fragmentation and the role of compaction. ↩
Important Limitation
Even when total unused memory is large, a process cannot run in fixed partitioning unless one partition is individually large enough to hold it.2
Footnotes
-
Memory Management in Operating System - GeeksforGeeks - Summary of partitioned memory allocation and fixed partition characteristics. ↩
-
Implementation of Contiguous Memory Management Techniques - GeeksforGeeks - Discusses fixed/variable partition schemes, placement algorithms, and fragmentation handling. ↩
Variable Partitioning
Variable partitioning, also called dynamic partitioning, was introduced to reduce the inefficiency of fixed partitions.2 Instead of pre-cutting memory into rigid blocks, the OS maintains free memory and allocates a block sized to the incoming process.2 Because the allocated region more closely matches the process size, internal fragmentation is greatly reduced or eliminated in the ideal model.2
This design improves memory utilization and supports a more flexible number of resident processes, because the number of partitions depends on the current workload rather than a static setup.2 It also avoids the fixed upper bound imposed by a predetermined partition count.
However, variable partitioning introduces more complex bookkeeping and placement decisions. The OS must decide where to place each new process using algorithms such as first fit, best fit, or next fit. Over time, as processes terminate and release memory, small holes form between allocated regions, producing external fragmentation.2
Footnotes
-
Difference between Fixed Partitioning and Variable Partitioning - GeeksforGeeks - Overview of definitions, features, and comparison. ↩ ↩2 ↩3
-
Variable (or Dynamic) Partitioning in Operating System - GeeksforGeeks - Explanation of dynamic partitioning and its motivation. ↩ ↩2 ↩3 ↩4
-
Implementation of Contiguous Memory Management Techniques - GeeksforGeeks - Discusses fixed/variable partition schemes, placement algorithms, and fragmentation handling. ↩ ↩2 ↩3 ↩4
-
Difference between Internal and External Fragmentation - GeeksforGeeks - Clarifies internal vs external fragmentation and the role of compaction. ↩
| Property | Description |
|---|---|
| Setup | Partitions are created in advance |
| Waste | Mostly internal fragmentation |
| Flexibility | Low |
| Complexity | Low |
| Process limit | Restricted by partition count |
| Typical issue | Small jobs waste space in large partitions2 |
Footnotes
-
Memory Management in Operating System - GeeksforGeeks - Summary of partitioned memory allocation and fixed partition characteristics. ↩
-
Difference between Internal and External Fragmentation - GeeksforGeeks - Clarifies internal vs external fragmentation and the role of compaction. ↩
Conceptual Comparison of Fixed and Variable Partitioning
Higher values indicate stronger presence of the listed property.
How Allocation Differs in Fixed and Variable Partitioning
- 1Step 1
In fixed partitioning, the OS creates static regions before execution begins. In variable partitioning, memory initially contains free space that will be split dynamically as requests arrive.3
Footnotes
-
Difference between Fixed Partitioning and Variable Partitioning - GeeksforGeeks - Overview of definitions, features, and comparison. ↩
-
Memory Management in Operating System - GeeksforGeeks - Summary of partitioned memory allocation and fixed partition characteristics. ↩
-
Variable (or Dynamic) Partitioning in Operating System - GeeksforGeeks - Explanation of dynamic partitioning and its motivation. ↩
-
- 2Step 2
The OS checks the memory requirement of the incoming process and determines whether a suitable contiguous region exists.2
Footnotes
-
Variable (or Dynamic) Partitioning in Operating System - GeeksforGeeks - Explanation of dynamic partitioning and its motivation. ↩
-
Implementation of Contiguous Memory Management Techniques - GeeksforGeeks - Discusses fixed/variable partition schemes, placement algorithms, and fragmentation handling. ↩
-
- 3Step 3
For fixed partitioning, the process is assigned to a partition large enough to hold it. For variable partitioning, the OS applies a placement strategy such as first fit, best fit, or next fit.
Footnotes
-
Implementation of Contiguous Memory Management Techniques - GeeksforGeeks - Discusses fixed/variable partition schemes, placement algorithms, and fragmentation handling. ↩
-
- 4Step 4
The process is placed into the chosen contiguous region. In fixed partitioning, leftover space inside the partition becomes internal fragmentation. In variable partitioning, the leftover unallocated memory remains as a separate free hole.3
Footnotes
-
Memory Management in Operating System - GeeksforGeeks - Summary of partitioned memory allocation and fixed partition characteristics. ↩
-
Variable (or Dynamic) Partitioning in Operating System - GeeksforGeeks - Explanation of dynamic partitioning and its motivation. ↩
-
Difference between Internal and External Fragmentation - GeeksforGeeks - Clarifies internal vs external fragmentation and the role of compaction. ↩
-
- 5Step 5
When the process terminates, its occupied region becomes free. In variable partitioning, repeated allocations and deallocations cause free space to become scattered through memory.2
Footnotes
-
Difference between Internal and External Fragmentation - GeeksforGeeks - Clarifies internal vs external fragmentation and the role of compaction. ↩
-
Implementation of Contiguous Memory Management Techniques - GeeksforGeeks - Discusses fixed/variable partition schemes, placement algorithms, and fragmentation handling. ↩
-
- 6Step 6
If the free space is scattered and cannot satisfy a large contiguous request, the OS may perform compaction to coalesce holes into a single large block.2
Footnotes
-
CSC 553 Operating Systems - Lecture 7 - Memory Management - Lecture notes explaining dynamic partitioning, compaction, and relocation cost. ↩
-
Implementation of Contiguous Memory Management Techniques - GeeksforGeeks - Discusses fixed/variable partition schemes, placement algorithms, and fragmentation handling. ↩
-
Direct Difference Between Fixed and Variable Partitioning
The two methods differ across design, efficiency, and operational behavior:
| Criterion | Fixed Partitioning | Variable Partitioning |
|---|---|---|
| Memory division | Done before execution | Done during execution |
| Partition count | Fixed | Variable |
| Partition size | Fixed or preset | Based on process size |
| Fragmentation type | Primarily internal fragmentation; some sources also note inefficiencies with unequal partitions2 | Primarily external fragmentation3 |
| Memory utilization | Lower when process sizes vary widely | Better than fixed partitioning |
| OS overhead | Lower | Higher |
| Process-size limitation | Cannot exceed largest partition | Limited mainly by available contiguous free memory |
| Need for compaction | Rarely central | Often required to counter external fragmentation2 |
A concise way to remember the distinction is:
Footnotes
-
Memory Management in Operating System - GeeksforGeeks - Summary of partitioned memory allocation and fixed partition characteristics. ↩
-
Memory Management - University lecture notes on fixed partitions, unequal partitions, dynamic partitioning, and compaction. ↩
-
Difference between Fixed Partitioning and Variable Partitioning - GeeksforGeeks - Overview of definitions, features, and comparison. ↩
-
Variable (or Dynamic) Partitioning in Operating System - GeeksforGeeks - Explanation of dynamic partitioning and its motivation. ↩
-
Difference between Internal and External Fragmentation - GeeksforGeeks - Clarifies internal vs external fragmentation and the role of compaction. ↩
-
CSC 553 Operating Systems - Lecture 7 - Memory Management - Lecture notes explaining dynamic partitioning, compaction, and relocation cost. ↩
-
Implementation of Contiguous Memory Management Techniques - GeeksforGeeks - Discusses fixed/variable partition schemes, placement algorithms, and fragmentation handling. ↩
Why Compaction Is Needed
Compaction is needed mainly in variable partitioning because free memory becomes fragmented into many small, separate holes after repeated loading and removal of processes.2 Suppose free memory exists as . A new process needing still cannot be loaded if no single contiguous hole is at least . This is the hallmark of external fragmentation.
Compaction solves this by relocating allocated processes so that all free holes are merged into one larger contiguous block.2 After compaction, the same total free space could become one hole, allowing the process to be admitted.2
Compaction therefore has three main purposes:
- To overcome external fragmentation.2
- To create larger contiguous blocks for incoming processes.2
- To improve usable memory availability without physically increasing RAM.
Yet compaction is expensive. The OS must move processes in memory and update their addresses using relocation support.2 This consumes CPU time and can temporarily reduce system performance, so compaction is helpful but not free.2
Footnotes
-
CSC 553 Operating Systems - Lecture 7 - Memory Management - Lecture notes explaining dynamic partitioning, compaction, and relocation cost. ↩ ↩2 ↩3 ↩4 ↩5 ↩6 ↩7 ↩8
-
Implementation of Contiguous Memory Management Techniques - GeeksforGeeks - Discusses fixed/variable partition schemes, placement algorithms, and fragmentation handling. ↩ ↩2 ↩3 ↩4 ↩5
-
Difference between Internal and External Fragmentation - GeeksforGeeks - Clarifies internal vs external fragmentation and the role of compaction. ↩ ↩2 ↩3
Common Conceptual Doubts
Lifecycle of Fragmentation and Compaction in Variable Partitioning
Initial State
Stage 1Memory contains a large free contiguous region before many processes are loaded."
Footnotes
-
Variable (or Dynamic) Partitioning in Operating System - GeeksforGeeks - Explanation of dynamic partitioning and its motivation. ↩
Dynamic Allocation
Stage 2Processes are allocated blocks close to their requested sizes, improving utilization.2"
Footnotes
-
Variable (or Dynamic) Partitioning in Operating System - GeeksforGeeks - Explanation of dynamic partitioning and its motivation. ↩
-
Implementation of Contiguous Memory Management Techniques - GeeksforGeeks - Discusses fixed/variable partition schemes, placement algorithms, and fragmentation handling. ↩
Process Exit
Stage 3Completed processes release memory, leaving holes between active processes.2"
Footnotes
-
Difference between Internal and External Fragmentation - GeeksforGeeks - Clarifies internal vs external fragmentation and the role of compaction. ↩
-
Implementation of Contiguous Memory Management Techniques - GeeksforGeeks - Discusses fixed/variable partition schemes, placement algorithms, and fragmentation handling. ↩
External Fragmentation
Stage 4Total free memory may be adequate, but it is not contiguous enough for a new request."
Footnotes
-
Difference between Internal and External Fragmentation - GeeksforGeeks - Clarifies internal vs external fragmentation and the role of compaction. ↩
Compaction
Stage 5The OS shifts processes together, consolidating free space into one larger block.2"
Footnotes
-
CSC 553 Operating Systems - Lecture 7 - Memory Management - Lecture notes explaining dynamic partitioning, compaction, and relocation cost. ↩
-
Implementation of Contiguous Memory Management Techniques - GeeksforGeeks - Discusses fixed/variable partition schemes, placement algorithms, and fragmentation handling. ↩
Exam Memory Aid
Associate fixed partitioning with internal fragmentation, and variable partitioning with external fragmentation plus compaction.3
Footnotes
-
Difference between Fixed Partitioning and Variable Partitioning - GeeksforGeeks - Overview of definitions, features, and comparison. ↩
-
CSC 553 Operating Systems - Lecture 7 - Memory Management - Lecture notes explaining dynamic partitioning, compaction, and relocation cost. ↩
-
Difference between Internal and External Fragmentation - GeeksforGeeks - Clarifies internal vs external fragmentation and the role of compaction. ↩
Final Understanding
Fixed partitioning and variable partitioning are both contiguous allocation techniques, but they optimize different goals.2 Fixed partitioning prioritizes simplicity and low overhead, yet wastes memory because partition sizes are rigid. Variable partitioning improves fit and utilization by allocating memory according to process need, but this flexibility creates external fragmentation over time.2
The need for compaction arises because contiguous allocation requires a process to fit into one uninterrupted block of memory.2 When free space is scattered, total memory alone is not enough; its arrangement matters. Compaction restores usability by gathering fragmented free areas into a single contiguous region, although the relocation cost makes it computationally expensive.2
In short:
- Fixed partitioning simple, static, more internal fragmentation.2
- Variable partitioning flexible, dynamic, more external fragmentation.2
- Compaction required to combat external fragmentation by merging free holes.3
Footnotes
-
Memory Management in Operating System - GeeksforGeeks - Summary of partitioned memory allocation and fixed partition characteristics. ↩ ↩2 ↩3
-
Variable (or Dynamic) Partitioning in Operating System - GeeksforGeeks - Explanation of dynamic partitioning and its motivation. ↩ ↩2 ↩3
-
Implementation of Contiguous Memory Management Techniques - GeeksforGeeks - Discusses fixed/variable partition schemes, placement algorithms, and fragmentation handling. ↩ ↩2 ↩3
-
CSC 553 Operating Systems - Lecture 7 - Memory Management - Lecture notes explaining dynamic partitioning, compaction, and relocation cost. ↩ ↩2 ↩3
-
Difference between Internal and External Fragmentation - GeeksforGeeks - Clarifies internal vs external fragmentation and the role of compaction. ↩ ↩2
-
Difference between Fixed Partitioning and Variable Partitioning - GeeksforGeeks - Overview of definitions, features, and comparison. ↩ ↩2
Knowledge Check
Which statement best distinguishes fixed partitioning from variable partitioning?
Explore Related Topics
Understanding Belady's Anomaly in Operating Systems
Belady's Anomaly shows that, for some page‑replacement policies, adding more physical frames can increase the number of page faults.
- FIFO (a non‑stack algorithm) does not satisfy the inclusion property and can exhibit the anomaly.
- On the reference string , FIFO yields faults with frames but faults with frames.
- Stack algorithms such as LRU or Optimal obey , guaranteeing that more frames never raise fault counts.
- Designing a virtual‑memory system with stack‑based replacement eliminates Belady's Anomaly.
Purpose of the Modify Bit in a Page Table
The modify (dirty) bit in a page‑table entry signals whether a page in RAM has been altered since it was loaded from its backing store, guiding the OS during page replacement.
- If the bit is 0 the page is clean and can be discarded; if 1 it is dirty and must be written back before the frame is reused.
- Hardware (or the MMU) sets the bit automatically on any write to the page.
- Eviction cost:
- It works with other status bits (present, accessed) to support efficient replacement policies and avoid unnecessary disk I/O.
Memory Fragmentation: Internal vs. External Fragmentation
Memory fragmentation describes how RAM becomes split into unusable pieces, with internal fragmentation wasting space inside fixed‑size partitions and external fragmentation scattering free holes that prevent contiguous allocations.
- Internal fragmentation per partition: ; total waste .
- External fragmentation occurs when but every hole , leaving a large request unsatisfiable.
- Compaction merges scattered holes into one block by relocating processes, but incurs high CPU and copying overhead.
- Paging removes external fragmentation by mapping pages to any frame, yet the last partially filled frame causes bounded internal fragmentation.
- Knuth’s 50‑percent rule predicts about free holes for allocated blocks under first‑fit dynamic partitioning.
