🎓 BookMCQ
← Back to 9. Virtual Memory

📝 Page fault frequency in thrashing (8 MCQs)

Monitoring Page-Fault Rates to Control Memory Pressure

Page-fault frequency is a virtual-memory management technique that controls frame allocation by monitoring how frequently a process experiences page faults. Instead of estimating every page in its working set, the operating system compares the observed fault rate with acceptable upper and lower limits. It can allocate additional frames when faults become excessive or reclaim frames when a process experiences sufficiently few faults.

Why Fault Frequency Indicates Inadequate Frame Allocation

A high page-fault rate often indicates that a process does not have enough resident frames to support its current memory locality. Conversely, a very low rate may indicate that the process has more frames than necessary. Monitoring these rates helps balance physical memory among competing processes. However, fault frequency is an indirect indicator and may not capture every change in working-set behaviour.

Upper and Lower Thresholds for Frame Adjustment

The operating system establishes an acceptable page-fault-frequency range. If a process exceeds the upper threshold, the memory manager attempts to allocate additional frames. If its rate falls below the lower threshold, some frames may be reclaimed for other processes. When no free frames remain and a process needs more, the system may suspend another process.

Responding to a High Page-Fault Rate

Suppose a process experiences 40 page faults per second, while the operating system sets an upper limit of 20 and a lower limit of 5. Its fault rate exceeds the permitted range, indicating possible frame shortage. The memory manager attempts to provide additional frames. If physical memory cannot satisfy the request, reducing active multiprogramming may be necessary.

Adaptive Allocation and Thrashing Prevention

Page-fault-frequency control allows frame allocations to respond dynamically to workload changes and helps reduce thrashing. Its implementation is simpler than maintaining an exact working-set history, but threshold selection affects stability. Delayed adjustment can allow excessive faults to continue, while overly aggressive allocation can starve other processes. It also requires careful handling when processes have fundamentally different memory-access patterns.

Common Errors About Fault-Frequency Monitoring

'A low fault rate always means a process has too few frames' is incorrect because it may indicate adequate or excessive allocation. 'The upper threshold causes frame reclamation' is incorrect because exceeding it normally requests more frames. 'Page-fault frequency directly measures CPU utilisation' is incorrect because it measures memory-fault activity, not processor usage.

Exam Focus: Threshold Decisions and Allocation Changes

Given a page-fault rate and upper and lower thresholds, determine whether frames should be allocated or reclaimed. Explain what happens when no free frames are available and excessive faults persist. Compare page-fault-frequency control with the working-set model, focusing on their measurements, adjustment methods, and roles in preventing thrashing.

Key Terms of Page-Fault Frequency

  • PFF - Page-fault frequency control.
  • Upper threshold - Maximum acceptable fault rate.
  • Lower threshold - Minimum monitored fault rate.
  • Frame adjustment - Changes process frame allocation.
  • Fault rate - Faults per reference or time.
  • Thrashing - Excessive paging activity.
2
Easy
4
Medium
2
Hard

📝 All Page fault frequency in thrashing MCQs

Q1. What is the name of the event that occurs when a process accesses a page that is not currently resident in memory?

A.page fault ✅
B.segmentation fault
C.general protection fault
D.bus error
💡 Difficulty: easy | ✅ Correct: A

📖 Explanation: A page fault is the specific event triggered when a process tries to use a page that the hardware finds marked invalid in the page table. The other choices describe different hardware exceptions that are unrelated to virtual memory paging. Understanding this term is essential because it signals the OS to begin the fault‑handling routine, which ultimately allows the process to continue execution after the needed page is loaded.

Q2. Why does the operating system check an internal table before deciding to terminate a process after a page fault?

A.to verify if the reference was to a valid address ✅
B.to locate a free frame for the page
C.to schedule a disk read for the page
D.to update the process priority
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: The OS consults the internal table to determine whether the faulting address was simply a valid reference to a page not yet in memory or an illegal memory access. If it is the former, the OS will load the page; if it is the latter, termination follows. Options B, C, and D describe later steps in the handling sequence, not the purpose of the initial check.

Q3. How does pure demand paging influence the overall number of page faults as a program runs to completion?

A.It eliminates all page faults after the first instruction
B.The number of faults grows linearly with program length
C.Faults occur only until each needed page has been loaded ✅
D.Faults increase exponentially
💡 Difficulty: medium | ✅ Correct: C

📖 Explanation: Pure demand paging loads pages only when they are first referenced, so faults happen exactly once for each distinct page the program needs. After every required page resides in memory, no further faults occur, which matches option C. The other options mischaracterize the behavior: faults are not eliminated immediately, nor do they grow without bound or explode exponentially.

Q4. A process is started with zero pages in memory. Which sequence of actions correctly describes the operating system’s response to the first instruction fetch?

A.The OS loads the entire program into memory before execution
B.The OS terminates the process immediately
C.The OS triggers a page fault, allocates a free frame, reads the needed page from disk, updates tables, and restarts the instruction ✅
D.The OS swaps out another process to make room
💡 Difficulty: medium | ✅ Correct: C

📖 Explanation: When the first instruction resides on a non‑resident page, the CPU raises a page fault. The OS then follows the standard handling steps: find a free frame, schedule a disk read, update the page and internal tables, and finally restart the instruction. Options A and B skip the fault handling, while D describes a different memory‑management action that is not the immediate response to the first fetch.

Q5. A system uses a page‑fault frequency (PFF) monitor that swaps a process out if its fault rate exceeds 0.05 faults per millisecond. Process X generates 120 faults while executing for 2 seconds. Which action will the monitor most likely take?

A.Swap out Process X ✅
B.Increase its priority
C.Allocate more frames to Process X
D.Ignore because the rate is below threshold
💡 Difficulty: hard | ✅ Correct: A

📖 Explanation: The fault rate is 120 faults/2000 ms=0.06120\text{ faults} / 2000\text{ ms}=0.06 faults/ms, which is higher than the 0.05 threshold, so the monitor will swap the process out to protect overall system performance. Raising priority or adding frames would reduce the fault rate but are not the monitor’s defined response. Ignoring the condition contradicts the policy, making option A the correct choice.

Q6. During a benchmark, a program incurs 45 page faults while executing 150,000 instructions. If each page fault costs 8 ms of disk I/O, what is the average overhead per instruction due to page faults? (Assume 1 ms=10−3 s1\,\text{ms}=10^{-3}\,\text{s}).

A.2.4×10−62.4\times10^{-6} s ✅
B.2.4×10−52.4\times10^{-5} s
C.2.4×10−42.4\times10^{-4} s
D.2.4×10−32.4\times10^{-3} s
💡 Difficulty: hard | ✅ Correct: A

📖 Explanation: Total fault time equals 45×8 ms=360 ms=0.36 s45 \times 8\text{ ms}=360\text{ ms}=0.36\text{ s}. Dividing by 150,000 instructions gives 0.36/150,000=2.4×10−60.36/150{,}000 = 2.4\times10^{-6} seconds per instruction, matching option A. The other options are off by factors of ten, reflecting common arithmetic mistakes. This calculation shows how even a modest number of faults can add measurable overhead to each instruction.

Q7. Which step in the page‑fault handling procedure most directly impacts system throughput?

A.Checking the internal table
B.Allocating a free frame
C.Scheduling the disk read ✅
D.Restarting the interrupted instruction
💡 Difficulty: medium | ✅ Correct: C

📖 Explanation: The disk read is the longest latency component; scheduling it determines how long the CPU must wait before the page becomes available, directly affecting throughput. Checking the table and allocating a frame are fast memory operations, and restarting the instruction is trivial once the page is in memory. Therefore, the scheduling of the I/O operation (option C) is the critical factor for overall performance.

Q8. If a page fault occurs and the operating system finds no free frames, what is the next logical step?

A.Terminate the process
B.Expand physical memory instantly
C.Select a victim page to evict ✅
D.Delay the fault until a frame becomes free
💡 Difficulty: easy | ✅ Correct: C

📖 Explanation: When no free frames exist, the OS must free one by choosing a victim page to evict, often using a replacement algorithm. Termination is reserved for illegal accesses, not resource shortage. Immediate physical memory expansion is unrealistic, and simply delaying does not resolve the lack of space. Selecting a victim page (option C) is the standard procedure that enables the OS to continue handling the fault.

🔗 Related Topics (MCQs)