Virtual Memory and Paging Basics Quiz Quiz

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.

  1. Virtual Address Translation

    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?

    1. Memory Management Unit
    2. Direct Memory Adaptor
    3. Peripheral Controller
    4. Central Processing Unit

    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.

  2. Page Replacement Policies

    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?

    1. Least Recently Used (LRU)
    2. Last-In First-Out (LIFO)
    3. Most Recently Used (MRU)
    4. First-In First-Out (FITO)

    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.

  3. Page Table Functionality

    Which structure in a virtual memory system keeps track of the mapping between virtual page numbers and physical frame numbers during program execution?

    1. Stack Pointer
    2. Page Table
    3. Bus Interface
    4. Segment Descriptor

    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.

  4. Page Size and Fragmentation

    Choosing a larger page size in a paging system can lead to increased internal fragmentation. What is internal fragmentation in this context?

    1. Unallocated gaps between pages
    2. Overlapping virtual addresses
    3. Unused memory within an allocated page
    4. Memory lost due to page faults

    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.

  5. Thrashing Phenomenon

    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?

    1. Cashing
    2. Crashing
    3. Chasing
    4. Thrashing

    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.