For the page reference string 7, 0, 1, 2, 0, 3, 0, 4, 2, 3, 0, 3, 2, 1, 2, 0, 1, 7, 0, 1 with 3 page frames (initially empty), which page replacement algorithm produces the minimum number of page faults?
Pick an option to check yourself, or open the answer below.
Show answer & explanation
Correct answer: D. Optimal
Explanation
Tracing all three frames across the 20 references gives FIFO 15 faults, LRU 12 faults, and the Optimal (Belady's MIN) algorithm — which always evicts the page that will be used farthest in the future — only 9 faults. This is not a quirk of this particular string: Optimal is provably a lower bound on the number of page faults for any reference string and any fixed number of frames, so no realizable algorithm such as FIFO, LRU or LIFO can ever do better. LIFO (replacing the most recently loaded page) performs worst of all here since it keeps evicting pages that are about to be reused. Hence the algorithm guaranteed to give the minimum number of faults is Optimal.More System Software and Operating System questions
- Which of the following is incorrect for virtual memory?
- A memory management system has 64 pages with a page size of 512 bytes. Physical memory consists of 32 page frames. The number of bits requi…
- Consider the page-reference string: 0 1 2 3 0 1 4 0 1 2 3 4. If the FIFO page-replacement algorithm is used, find the number of page faults…
- Indexed/grouped allocation (of disk blocks to a file) is useful because: (A) It supports both sequential and direct access. (B) The entire…
- A moving-head disk has 200 tracks, numbered 0 to 199. The head has just finished a request at track 125 and is currently at track 143 (so i…
- In a file allocation system, the following allocation schemes are used: (A) Contiguous allocation, (B) Indexed allocation, (C) Linked alloc…