Explore key concepts of OS-level memory management, including virtual memory, paging, fragmentation, and allocation techniques. This quiz helps evaluate your understanding of crucial mechanisms ensuring efficient use of system memory.
Which of the following best describes virtual memory in an operating system, such as when a program uses more memory than what is physically available?
Explanation: Virtual memory allows an operating system to use hard disk space to simulate extra RAM, letting programs exceed physical memory limits. Limiting addresses to physical RAM is not virtual memory; it's traditional memory management. Virtual memory is not exclusive to device drivers, nor is it a cache dedicated to CPU instructions. These misconceptions often confuse key terms in memory management.
When a page fault occurs, which page replacement algorithm selects the page that has not been used for the longest period of time for replacement?
Explanation: The Least Recently Used (LRU) algorithm replaces the page that hasn't been accessed for the longest time, optimizing for recent usage trends. FIFO replaces the oldest loaded page, not the least recently used. Random Replacement makes selections arbitrarily, and MRU would replace the most recently used page, which seldom makes sense in practice. Proper understanding prevents mixing up these concepts.
In OS-level memory schemes, which major difference distinguishes segmentation from paging when managing program memory?
Explanation: Segmentation divides memory based on logical program divisions like functions or data structures, whereas paging slices memory into equal-sized blocks regardless of program structure. Paging does not use variable-size segments, and both can use hardware address translation, though address relocation isn't unique to paging. Segmentation and paging differ fundamentally and are not identical.
Which type of fragmentation occurs when fixed-size memory blocks leave unused space within allocated regions, as might happen in a block-based memory allocator?
Explanation: Internal fragmentation happens when allocated blocks are fixed and not fully occupied, leading to wasted space inside allocated areas. External fragmentation describes unused space scattered between allocated blocks, not within them. Logical fragmentation and stack fragmentation are incorrect terms in this context; they do not describe standard memory management issues.
What is the primary role of the Memory Management Unit (MMU) in an operating system, such as when translating program addresses to physical locations?
Explanation: The main function of the MMU is to translate virtual addresses used by programs into actual physical RAM addresses, enabling features like virtual memory and isolation. The MMU does not manage CPU instruction execution, nor does it handle permanent storage of user data. Scheduling processes is handled by separate OS components, not the MMU.