Question
Download Solution PDFConsider the virtual page reference string 1, 2, 3, 2, 4, 1, 3, 2, 4, 1
Let a computer system has main memory size of 3 page frames which are initially empty and it is running on demand paged virtual memory system. The number of page faults under LRU and FIFO page replacement policy are respectively:
Answer (Detailed Solution Below)
Detailed Solution
Download Solution PDFConcept:
LRU Page Replacement Policy:
LRU (Least recently used) page replacement algorithm is based on the assumption that the page that has been used in the last few instructions will be referenced in the next few instructions. It replaces the page that has not been referenced for the longest time.
Explanation:
Reference string: 1, 2, 3, 2, 4, 1, 3, 2, 4, 1
Number of frames = 3
1 | 1 | 1 | 1 | 4 | 4 | 4 | 2 | 2 | 2 | |
2 | 2 | 2 | 2 | 2 | 3 | 3 | 3 | 1 | ||
3 | 3 | 3 | 1 | 1 | 1 | 4 | 4 | |||
Page Fault | 1 | 1 | 1 | 0 | 1 | 1 | 1 | 1 | 1 | 1 |
Here, total page faults = 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1= 9
FIFO Page Replacement Policy:
It is based on the principle of first in first out. The page which is accessed first in the sequence is replaced first. Also, we can say that during the page fault, the page that has been in memory the longest is replaced.
Explanation:
Reference string: 1, 2, 3, 2, 4, 1, 3, 2, 4, 1
Total frames allocated are 3
1 | 1 | 1 | 1 | 4 | 4 | 4 | 4 | 4 | 4 | |
2 | 2 | 2 | 2 | 1 | 1 | 1 | 1 | 1 | ||
3 | 3 | 3 | 3 | 3 | 2 | 2 | 2 | |||
Page Fault | 1 | 1 | 1 | 0 | 1 | 1 | 0 | 1 | 0 | 0 |
Last updated on Jul 12, 2025
-> HTET Exam Date is out. HTET Level 1 and 2 Exam will be conducted on 31st July 2025 and Level 3 on 30 July
-> Candidates with a bachelor's degree and B.Ed. or equivalent qualification can apply for this recruitment.
-> The validity duration of certificates pertaining to passing Haryana TET has been extended for a lifetime.
-> Enhance your exam preparation with the HTET Previous Year Papers.