In demand paging, when a program accesses a page not currently in physical memory, a page fault occurs. What is the immediate action taken by the operating system?
Think about what the OS must do to allow the program to continue after accessing a missing page.
When a page fault occurs, the OS must bring the missing page from disk into physical memory so the program can access it. This is the core mechanism of demand paging.
In demand paging, which data structure does the operating system use to know which pages are loaded in physical memory?
This structure maps virtual addresses to physical addresses.
The page table keeps track of which virtual pages are in physical memory and their frame locations. It is essential for address translation in demand paging.
Demand paging loads pages only when needed. Which of the following best explains how this improves system performance?
Consider how loading fewer pages initially affects memory and disk usage.
Demand paging loads only pages that a program actually uses, reducing memory consumption and disk reads compared to loading all pages upfront, which can improve overall system responsiveness.
Which statement correctly contrasts demand paging with pre-paging?
Think about when pages are loaded in each method.
Demand paging waits until a page is needed to load it, while pre-paging tries to predict and load pages before they are accessed to reduce page faults.
Thrashing occurs when a system spends more time handling page faults than executing processes. What is the main cause of thrashing in demand paging?
Consider what happens when the memory needed by a process exceeds what is available.
Thrashing happens when a process's working set does not fit in physical memory, causing frequent page faults and excessive swapping, which slows down the system.