Memory Management
Memory Management
Fixed Partitioning
The memory is divided into a set number of partitions of fixed sizes. Each partition
can only hold one process, and its size is predetermined. However, this can lead to
internal fragmentation, where a process doesn’t use the entire partition, wasting
memory.
Dynamic (Variable) Partitioning
Memory is divided into partitions based on the needs of processes. Partitions are
created dynamically as programs request memory. This helps in reducing internal
fragmentation but can lead to
external fragmentation: where free memory is scattered in small blocks.
In contiguous memory management techniques, the two main types are:
1. Fixed Partitioning (Fixed-Sized Partitioning):
- Memory is divided into fixed-size partitions.
- Each partition is allocated to one process.
- Any unused space in a partition leads to internal fragmentation.
- The number of partitions is fixed, limiting the number of processes that can be in memory at once.
2. Best Fit:
- The system searches for the smallest available block of memory that is large enough to fulfill the process's requirements.
- This minimizes leftover memory (reducing external fragmentation), but it can lead to slower allocation since the system must
search through all available blocks to find the best match.
3. Worst Fit:
- The system allocates the largest available block of memory to a process.
- The idea is that by leaving large blocks of memory free, future allocations will have more room. However, it often increases
fragmentation by leaving smaller unusable memory chunks.
Numerical on: Fixed Partitioning (Fixed-Sized Partitioning):
Calculate Internal and External Fragmentation for given scenario
Process Required Storage. 200 400 600 500 300 250
P1 375
P2 210
P3 468
P4 491
200 400 600 500 300 250
First Fit
Best Fit
200 400 600 500 300 250
Worst Fit
First Fit
50 150 300 350 600
Best Fit
Worst Fit