What is the main purpose of using overlays in memory management ?
ATo increase the physical memory size
BTo allow programs larger than memory to execute
CTo eliminate external fragmentation
DTo increase CPU speed
Answer:
B. To allow programs larger than memory to execute
Read Explanation:
Concept of Overlays
- Definition: An overlay is a memory management technique that allows a process to run even if its total size exceeds the available physical memory (RAM).
- Mechanism: The process is divided into several modules or segments. Only the essential parts (the root or main module) are loaded into RAM initially. Other modules are loaded from secondary storage (disk) into the same memory space only when required.
- Execution Logic: When a module is no longer needed, it is overwritten (overlapped) by the next required module in the same memory partition.
Key Technical Details
- Memory Efficiency: It allows large programs to execute on machines with limited main memory, which was critical in the early days of computing (mainframes).
- Programmer Responsibility: Unlike modern demand paging, the overlay structure had to be manually designed by the programmer. The programmer had to explicitly define which modules were mutually exclusive and could share the same memory address space.
- Design Requirement: Modules that are never executed simultaneously are candidates for the same overlay area.
Limitations and Modern Context
- Complexity: Manually managing overlays is highly error-prone and increases the development time significantly.
- Replacement: In modern operating systems, overlays have been largely replaced by Virtual Memory and Demand Paging. These techniques handle memory management automatically at the OS level, removing the burden from the programmer.
- Performance: Frequent swapping of modules between disk and RAM (overlay swapping) can lead to significant performance overhead if not carefully managed.
