Relocation and External Fragmentation
Relocation and External Fragmentation
1. Relocation
1.1 Definition
Relocation in operating systems refers to the ability to move processes within memory during their
execution. It allows efficient utilization of memory by dynamically adjusting the physical location of
processes.
3. Flexibility:
o Ensures that a process can execute irrespective of its initial location in memory.
o Processes generate logical addresses, which are translated into physical addresses by
the memory management unit (MMU).
2. Relocation Register:
o A hardware register stores the base address of a process. Logical addresses are added to
the relocation register to compute the physical address.
o Static Relocation: Done before execution; the process remains in the same memory
location.
2. External Fragmentation
2.1 Definition
External fragmentation occurs when free memory is scattered into small, non-contiguous blocks, making
it challenging to allocate large contiguous memory spaces even though sufficient total free memory
exists.
2. Process Termination:
3. Non-contiguous Allocation:
1. Wasted Memory:
2. Reduced Performance:
3. Compaction Overhead:
3. Buddy System:
2. Processes:
4. New Process D requires 350 KB, but cannot be allocated because the 300 KB hole is insufficient,
and memory is non-contiguous.
Relocation can mitigate external fragmentation by dynamically moving processes to consolidate free
memory.
1. Initial State:
2. After Relocation:
4. Real-World Applications
1. Operating Systems:
o Relocation is widely used in systems with dynamic memory allocation, like Windows and
Linux.
2. Memory Compaction:
3. Paging Systems: