Assess your understanding of demand paging, page faults, and the working set model in memory management. This quiz covers core concepts, common scenarios, and essential terminology for efficient virtual memory operation.
In demand paging, which event typically causes a page to be loaded into main memory for the first time?
Explanation: Demand paging loads pages into memory only when a page fault indicates the page is needed. Preloading all pages at process start is not demand paging, but eager loading. Memory is limited, so keeping all pages in memory or relying on user selection is not typical of demand paging. Page faults efficiently signal which pages are required.
What happens when a process tries to access a page that is not currently in physical memory?
Explanation: When a required page is not in memory, a page fault triggers the loading of the missing page from disk. Immediate termination is not standard behavior for a missing page. Swapping the entire process is inefficient and not the response to a single page fault. Ignoring the access would cause undefined or incorrect program operation.
What does the working set model represent in virtual memory systems?
Explanation: The working set refers to the set of pages a process has used within a recent interval, indicating active use. It is dynamic and changes as the process accesses new pages. The complete set of allocated pages may include inactive pages. Pages swapped out or locked are not necessarily part of the current working set.
Which situation best describes thrashing in a demand paging system?
Explanation: Thrashing occurs when page faults are so frequent that the CPU spends most of its time swapping pages instead of executing processes. Occasional secondary memory access is normal and doesn't indicate thrashing. A system with no page faults is not thrashing. Manual page selection isn't typical and doesn't relate to thrashing.
How does demand paging improve memory utilization compared to simple paging?
Explanation: By loading only the actively used pages, demand paging makes better use of memory, potentially allowing more processes to run. Loading all pages at once increases memory usage, which is less efficient. Requiring more swap space per process is not a direct feature of demand paging. Placing all data in cache is unrelated and inaccurate.
Why is an effective page replacement policy important in a demand-paging system?
Explanation: A good page replacement policy ensures that the most relevant pages remain in memory, minimizing page faults. Increasing the page table size is not a direct benefit. Secondary storage is still required regardless of the policy. Instant process completion is unrealistic and not related to the policy.
Which concept does the working set model rely on to predict future page usage?
Explanation: The working set model assumes that processes tend to access the same pages repeatedly for some time—this is called locality of reference. Random access and equal probability contradict this principle. Static allocation does not account for dynamic working set behavior during process execution.
In demand paging, what is the main purpose of the page table for a process?
Explanation: The page table translates virtual addresses to their corresponding physical locations and tracks whether pages are loaded. It does not list system processes or store source code. Recording I/O operations is handled elsewhere.
When a page fault occurs, which of the following describes the first step the operating system takes?
Explanation: Upon a page fault, the operating system first verifies if the address is legal for the process. Terminating the process is only necessary if the access is invalid. Writing all dirty pages is not always required and would be inefficient. Loading every page defeats the purpose of demand paging.
What is a likely consequence if the allocated physical memory for a process is smaller than its working set size?
Explanation: If physical memory cannot hold the working set, pages required by the process will constantly be swapped in and out, increasing page faults. Running faster is unlikely with high page fault rates. Not all required pages can be in memory, so frequent replacements occur. The option stating page replacement will no longer occur is incorrect, as it would in fact happen more often.