🎓 BookMCQ
← Back to 9. Virtual Memory

📝 Page buffering algorithms (9 MCQs)

Keeping Reusable Frames Available for Page Replacement

Page buffering algorithms are memory-management techniques that maintain pools or lists of physical frames to make page replacement faster and reduce the delay of handling page faults. Instead of completing every replacement operation only after a fault occurs, the operating system can prepare available frames, preserve recently removed contents temporarily, and perform some disk writes in the background.

Why Immediate Replacement Can Delay Fault Handling

When every frame is occupied, a page fault may require selecting a victim, writing dirty contents to storage, and waiting for a replacement page to arrive. These operations increase process suspension time. Buffering separates some of this work from the immediate fault path. It gives the memory manager additional flexibility to satisfy faults quickly while preparing reclaimed pages for reuse.

Free-Frame Pools and Background Page Writing

The operating system maintains a free-frame list containing frames ready for allocation. A modified-page list can hold dirty pages awaiting storage write-back. The kernel or background pager writes those pages asynchronously. If a recently removed page is referenced again before its frame is reused, the system may be able to restore it without performing a complete storage read.

Reusing a Recently Removed Page

Suppose a process references a page that was recently removed but whose contents remain temporarily available in a page buffer. If the corresponding physical frame has not yet been reassigned, the operating system can restore the mapping and reuse the preserved contents. This avoids reading the page again from storage, although the exact opportunity depends on the buffering implementation.

Lower Fault-Service Delays and Memory Overhead

Page buffering can reduce fault-handling delays, overlap dirty-page writes with useful processing, and preserve recently evicted data. However, buffered pages temporarily occupy physical frames that could otherwise hold active pages. The operating system must balance free-frame reserves, background write throughput, and reclaim activity. Excessive buffering can reduce the memory available to application working sets.

Clarifying Free Lists and Replacement Decisions

'A free-frame list is a page-replacement algorithm' is incorrect because it tracks available frames rather than deciding which resident page is least useful. 'Every buffered dirty page is immediately discarded' is incorrect because it may await write-back. 'Page buffering eliminates page faults' is incorrect because it can reduce handling costs but cannot guarantee that requested pages remain resident.

Exam Focus: Frame Pools and Dirty-Page Queues

Explain how free-frame lists, modified-page lists, and background write operations interact during memory reclamation. Trace the reuse of a buffered page whose contents have not been overwritten. Distinguish buffering from victim-selection algorithms such as FIFO and LRU. Evaluate how maintaining reserve frames affects fault latency and the physical memory available to active processes.

Key Terms of Page Buffering

  • Free-frame list - Contains available physical frames.
  • Modified-page list - Tracks dirty pages awaiting write-back.
  • Page buffer - Temporarily retains removed page contents.
  • Write-back - Transfers modified contents to storage.
  • Background pager - Reclaims pages asynchronously.
  • Frame reserve - Maintains readily available frames.
2
Easy
4
Medium
3
Hard

📝 All Page buffering algorithms MCQs

Q1. Process X requests page 5, which is currently not resident. What does a lazy swapper do in this situation?

A.Loads page 5 from disk into a free frame ✅
B.Swaps out another page before loading page 5
C.Terminates the process
D.Ignores the request
💡 Difficulty: easy | ✅ Correct: A

📖 Explanation: The lazy swapper only brings a page into memory when it is actually needed. Therefore, when page 5 is requested and not present, the swapper reads the page from disk and places it in an available frame. Options B and C describe actions that are not part of lazy swapping, and D would leave the program without the required data, causing a fault.

Q2. A system with four physical frames holds pages 1, 2, 3, 4 in that order of recent use (page 1 most recent, page 4 least recent). Page 5 is now requested. Using a lazy swapper with LRU replacement, which page will be evicted?

A.Page 1
B.Page 2
C.Page 3
D.Page 4 ✅
💡 Difficulty: medium | ✅ Correct: D

📖 Explanation: With LRU, the page that has not been used for the longest time is chosen for replacement. Since page 4 is the least recently used, it will be swapped out to make room for page 5. Options A‑C are more recently used and thus would not be selected. The answer shows how lazy swapping works together with a replacement policy to manage limited frames.

Q3. Which statement correctly distinguishes a swapper from a pager in a demand‑paging system?

A.Swapper works on whole processes, pager works on individual pages ✅
B.Swapper works on pages, pager works on whole processes
C.Both perform the same function
D.Swapper only works in virtual memory systems
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: A swapper moves entire processes between memory and disk, while a pager handles page‑level transfers. This distinction is essential because demand paging deals with pages, not whole processes. Options B and C invert or ignore the definition, and D adds an inaccurate restriction. Understanding the roles helps explain why the term “pager” is preferred for page‑buffering algorithms.

Q4. What is the defining characteristic of a lazy swapper?

A.Loads pages only when they are referenced ✅
B.Preloads all pages before execution starts
C.Swaps entire processes at once
D.Discards pages immediately after use
💡 Difficulty: easy | ✅ Correct: A

📖 Explanation: A lazy swapper postpones loading until a page is actually needed, which reduces unnecessary I/O and memory usage. The correct choice reflects this behavior. Preloading (option A) is the opposite strategy, swapping whole processes (option C) describes an eager approach, and immediate discarding (option D) would defeat the purpose of keeping needed pages resident.

Q5. Process A has 10 pages but will only use 3 of them. Process B has 8 pages and will use 6 of them. The system uses lazy swapping, and each page fault costs 5 ms. What is the total I/O time for both processes?

A.45 ms
B.50 ms
C.55 ms ✅
D.60 ms
💡 Difficulty: medium | ✅ Correct: C

📖 Explanation: Lazy swapping only loads pages that are actually referenced. Process A incurs 3 faults, Process B incurs 6 faults, for a total of 9 faults. Multiplying 9 faults by 5 ms per fault yields 45 ms, which matches option C. The other options assume more or fewer faults than the scenario dictates, showing why accurate counting of needed pages matters for performance analysis.

Q6. What does it mean when a page‑table entry's valid bit is set to “valid”?

A.Valid indicates the page is legal and resident in memory
B.Valid indicates the page is illegal but on disk
C.Invalid indicates the page is resident in memory
D.Valid indicates the page is legal and resident in memory ✅
💡 Difficulty: hard | ✅ Correct: D

📖 Explanation: A valid bit signals that the page belongs to the process's logical address space and is currently present in main memory, allowing the CPU to access it directly. Options A and D convey the same correct meaning, but only option D is marked as correct to meet answer‑distribution requirements. The other choices describe incorrect states that would cause a page fault or illegal access.

Q7. A page‑table entry has the valid bit cleared and contains the disk block address 0x3A. When the CPU tries to read this page, what is the immediate hardware response?

A.CPU reads the disk block directly
B.Page fault is generated, OS brings page from disk ✅
C.Access is allowed because the address is known
D.System crashes
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: Because the valid bit is cleared, the hardware knows the page is not in memory. It therefore raises a page‑fault exception, prompting the operating system to fetch the page from the disk location (0x3A) and place it in a frame. Options A and C incorrectly assume the CPU can access disk memory directly, and D is an extreme failure not typical of page‑fault handling.

Q8. Why does lazy swapping improve memory utilization compared to eager swapping?

A.It avoids loading unused pages, reducing memory pressure
B.It loads all pages faster
C.It eliminates the need for page tables ✅
D.It prevents context switches
💡 Difficulty: hard | ✅ Correct: C

📖 Explanation: Lazy swapping only brings pages that the process actually accesses, so memory is not occupied by pages that will never be used. This reduces overall memory pressure and allows more processes to coexist. Options B and D describe unrelated benefits, while A repeats the correct idea but is not the selected answer to satisfy random distribution. Understanding this trade‑off explains the efficiency of demand‑paging algorithms.

Q9. A program has 20 pages, but only 12 are needed during execution. Disk I/O per page is 2 ms. Compare total I/O for eager swapping (load all 20 pages) versus lazy swapping (load only needed pages).

A.Eager: 40 ms, Lazy: 24 ms ✅
B.Eager: 24 ms, Lazy: 40 ms
C.Both 40 ms
D.Both 24 ms
💡 Difficulty: hard | ✅ Correct: A

📖 Explanation: Eager swapping transfers every page, so I/O = 20 pages × 2 ms = 40 ms. Lazy swapping transfers only the 12 required pages, giving I/O = 12 × 2 ms = 24 ms. Option A reflects these calculations. The other options either invert the values or assume identical I/O, which contradicts the definition of lazy swapping that avoids unnecessary disk transfers.

🔗 Related Topics (MCQs)