ITPEC FE Subject A October 2025 Question 15

Topic: Software

The page capacity of main memory is three pages, and the pages are referenced in the order {1, 2, 3, 2, 1, 4, 5}. Which of the following is the page that will be replaced from main memory for the last page reference if LRU is used as the page replacement technique?

Explanation

Page 2 — track when each page was last used, hits included, and replace the one unused for longest.

ReferenceResultFrames afterReplaced
1miss1none
2miss1, 2none
3miss1, 2, 3none
2hit1, 2, 3none
1hit1, 2, 3none
4miss1, 2, 43
5miss1, 4, 52

At the reference to 4, page 3 was last used at step 3, earlier than 2 (step 4) and 1 (step 5). At the reference to 5, page 2 was last used at step 4, earlier than 1 (step 5) and 4 (step 6).

Answer (b)

Why not others:

  • •(c) 3 — is the page replaced at the reference to 4, one step earlier; by the last reference it is no longer in memory
  • •(a) 1 — was used at step 5, more recently than page 2
  • •(d) 4 — is the most recently used page; it would go under LFU, having been used only once, but LRU looks at recency

Key rule: LRU ranks pages by their last use, so every hit refreshes a page; FIFO ranks by load time and ignores hits, and LFU counts uses.

Software · AI-written, may contain errors

This question comes from an official ITPEC past paper. ITPEC Practice is an independent study tool and is not affiliated with ITPEC. See the official FE past-paper collection or Report an issue.