Explore essential concepts of virtual memory, paging, and their role in modern operating systems. Assess your understanding of memory management techniques, page replacement policies, and the structure of virtual address spaces.
When a program accesses a specific memory location, which component translates the program's virtual address to a physical address in the system's RAM?
Explanation: The Memory Management Unit (MMU) is responsible for converting virtual addresses to physical addresses in RAM. The Central Processing Unit executes instructions but relies on the MMU for address translation. The Peripheral Controller handles external devices, not memory translation. The Direct Memory Adaptor is not involved in virtual address translation; it is a distractor similar in name but not function.
If a physical memory is full and a new page needs to be loaded, which classic algorithm selects the page that has not been used for the longest time to be replaced?
Explanation: The Least Recently Used (LRU) algorithm replaces the page that has not been accessed for the longest duration, optimizing for programs with locality of reference. First-In First-Out (FITO) is a typo; the correct term is FIFO, which removes the oldest page regardless of recent use. Last-In First-Out (LIFO) replaces the most recent page, which is rarely used in paging. Most Recently Used (MRU) does the opposite of LRU and is less common in main memory management.
Which structure in a virtual memory system keeps track of the mapping between virtual page numbers and physical frame numbers during program execution?
Explanation: The page table stores the relationships between virtual pages and physical memory frames, allowing efficient translation during memory accesses. Segment descriptors are used in segmentation, a different memory management technique. The bus interface manages communication between hardware components, not address mappings. The stack pointer simply tracks the top of the program stack and is unrelated to address translation.
Choosing a larger page size in a paging system can lead to increased internal fragmentation. What is internal fragmentation in this context?
Explanation: Internal fragmentation refers to wasted space within an allocated page when a process does not use the entire page. Unallocated gaps between pages describe external fragmentation, which paging attempts to minimize. Memory lost due to page faults is not fragmentation; it is an overhead event. Overlapping virtual addresses should not occur in properly managed virtual memory systems, making it incorrect.
In a multitasking system, what occurs when frequent page faults cause the CPU to spend more time swapping pages in and out of memory than executing instructions?
Explanation: Thrashing happens when a system is overloaded with page faults, severely reducing performance as the processor constantly swaps pages instead of running programs. 'Cashing' and 'chasing' are distractors that sound similar but are not memory management terms. 'Crashing' refers to application or system failure, not to the high paging activity described in the scenario.