A process refers to 5 pages A, B, C, D, E in the order: A; B; C; D; A; B; E;…
2018
A process refers to 5 pages A, B, C, D, E in the order: A; B; C; D; A; B; E; A; B; C; D; E If the page replacement algorithm is FIFO, then the number of pages which transfer from an empty internal store of 3 frames is —
- A.
8
- B.
10
- C.
9
- D.
7
Attempted by 242 students.
Show answer & explanation
Correct answer: C
FIFO algorithm with 3 frames (initially empty):
Reference 1: A → Frames: [A] ; Page fault (1)
Reference 2: B → Frames: [A, B] ; Page fault (2)
Reference 3: C → Frames: [A, B, C] ; Page fault (3)
Reference 4: D → Evict oldest (A) → Frames: [B, C, D] ; Page fault (4)
Reference 5: A → Not in frames, evict oldest (B) → Frames: [C, D, A] ; Page fault (5)
Reference 6: B → Not in frames, evict oldest (C) → Frames: [D, A, B] ; Page fault (6)
Reference 7: E → Not in frames, evict oldest (D) → Frames: [A, B, E] ; Page fault (7)
Reference 8: A → A is in frames [A, B, E] ; Hit (no page fault)
Reference 9: B → B is in frames [A, B, E] ; Hit (no page fault)
Reference 10: C → Not in frames, evict oldest (A) → Frames: [B, E, C] ; Page fault (8)
Reference 11: D → Not in frames, evict oldest (B) → Frames: [E, C, D] ; Page fault (9)
Reference 12: E → E is in frames [E, C, D] ; Hit (no page fault)
Total page transfers = 9. Each page fault causes a transfer, so transfers = 9.