GATE - 2012 | OS | Consider the virtual page reference string 1, 2, 3, 2, 4, 1, 3, 2, 4, 1 On a

GATE - 2012 | OS | Consider the virtual page reference string 1, 2, 3, 2, 4, 1, 3, 2, 4, 1 On a
Posted on 12-02-2022

GATE - 2012 [Operating System]

Question:

Consider the virtual page reference string 1, 2, 3, 2, 4, 1, 3, 2, 4, 1 On a demand paged virtual memory system running on a computer system that main memory size of 3 pages frames which are initially empty. Let LRU, FIFO and OPTIMAL denote the number of page faults under the corresponding page replacements policy. Then

A

OPTIMAL < LRU < FIFO

B

OPTIMAL < FIFO < LRU

C

OPTIMAL = LRU

D

OPTIMAL = FIFO

  

Solution:

Option (B) is Correct.

FIFO:

Consider the virtual page reference string 1, 2, 3, 2, 4, 1, 3, 2, 4, 1 On a demand paged virtual memory system running on a computer system that main memory size of 3 pages frames which are initially empty. Let LRU, FIFO and OPTIMAL denote the number of page faults under the corresponding page replacements policy. Then A OPTIMAL < LRU < FIFO OPTIMAL < FIFO < LRU OPTIMAL = LRU D OPTIMAL = FIFO

No. of page faults with FIFO = 6
LRU:

Consider the virtual page reference string 1, 2, 3, 2, 4, 1, 3, 2, 4, 1 On a demand paged virtual memory system running on a computer system that main memory size of 3 pages frames which are initially empty. Let LRU, FIFO and OPTIMAL denote the number of page faults under the corresponding page replacements policy. Then

No. of page faults with LRU = 9
Optimal:

Consider the virtual page reference string 1, 2, 3, 2, 4, 1, 3, 2, 4, 1 On a demand paged virtual memory system running on a computer system that main memory size of 3 pages frames which are initially empty. Let LRU, FIFO and OPTIMAL denote the number of page faults under the corresponding page replacements policy. Then

No. of page faults with optimal = 5
∴ Optimal < FIFO < LRU

Thank You