Computer Science Engineering (CSE) Exam  >  Computer Science Engineering (CSE) Questions  >  Consider the virtual page reference string 1,... Start Learning for Free
Consider 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:
  • a)
    9
  • b)
    6
  • c)
    8
  • d)
    3
Correct answer is option 'A,B'. Can you explain this answer?
Most Upvoted Answer
Consider the virtual page reference string 1, 2, 3, 2, 4, 1, 3, 2, 4, ...
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.
Reference string: 1, 2, 3, 2, 4, 1, 3, 2, 4, 1
Number of frames =3
  
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.
Reference string: 1, 2, 3, 2, 4, 1, 3, 2, 4, 1
Total frames allocated are 3.
 
Here, total page faults = 1 + 1 + 1 + 0 + 1 + 0 + 1 + 0 + 0 = 6
Hence, the correct options are (A) and (B).
Free Test
Community Answer
Consider the virtual page reference string 1, 2, 3, 2, 4, 1, 3, 2, 4, ...
Page Replacement Policies
Page replacement policies are used in computer systems to decide which pages to remove from main memory when there is a page fault and new pages need to be brought in. Two commonly used page replacement policies are LRU (Least Recently Used) and FIFO (First-In-First-Out).

Virtual Page Reference String
In this question, we are given the virtual page reference string: 1, 2, 3, 2, 4, 1, 3, 2, 4, 1. This string represents the sequence of page references made by a process.

Main Memory Size
The computer system has a main memory size of 3 page frames, which means it can hold 3 pages at a time.

LRU Page Replacement Policy
To determine the number of page faults using the LRU page replacement policy, we simulate the execution of the virtual page reference string and keep track of the currently loaded pages.

1. Initially, all page frames are empty.
2. When the first page reference 1 is made, we bring it into the first page frame. The page fault count is 1.
3. When the second page reference 2 is made, we bring it into the second page frame. The page fault count is 2.
4. When the third page reference 3 is made, we bring it into the third page frame. The page fault count is 3.
5. When the fourth page reference 2 is made, we find that page 2 is already in the second page frame. We update its position to the most recently used position. The page fault count remains 3.
6. When the fifth page reference 4 is made, we replace page 1 in the first page frame with page 4. The page fault count is 4.
7. When the sixth page reference 1 is made, we replace page 3 in the third page frame with page 1. The page fault count is 5.
8. When the seventh page reference 3 is made, we replace page 2 in the second page frame with page 3. The page fault count is 6.
9. When the eighth page reference 2 is made, we find that page 2 is already in the second page frame. We update its position to the most recently used position. The page fault count remains 6.
10. When the ninth page reference 4 is made, we find that page 4 is already in the first page frame. We update its position to the most recently used position. The page fault count remains 6.
11. When the tenth page reference 1 is made, we find that page 1 is already in the third page frame. We update its position to the most recently used position. The page fault count remains 6.

Therefore, the number of page faults under the LRU page replacement policy is 6.

FIFO Page Replacement Policy
To determine the number of page faults using the FIFO page replacement policy, we again simulate the execution of the virtual page reference string and keep track of the currently loaded pages.

1. Initially, all page frames are empty.
2. When the first page reference 1 is made, we bring it into the first page frame. The page fault count is 1.
3. When the second page reference 2 is made, we
Explore Courses for Computer Science Engineering (CSE) exam

Similar Computer Science Engineering (CSE) Doubts

Top Courses for Computer Science Engineering (CSE)

Consider 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:a)9b)6c)8d)3Correct answer is option 'A,B'. Can you explain this answer?
Question Description
Consider 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:a)9b)6c)8d)3Correct answer is option 'A,B'. Can you explain this answer? for Computer Science Engineering (CSE) 2024 is part of Computer Science Engineering (CSE) preparation. The Question and answers have been prepared according to the Computer Science Engineering (CSE) exam syllabus. Information about Consider 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:a)9b)6c)8d)3Correct answer is option 'A,B'. Can you explain this answer? covers all topics & solutions for Computer Science Engineering (CSE) 2024 Exam. Find important definitions, questions, meanings, examples, exercises and tests below for Consider 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:a)9b)6c)8d)3Correct answer is option 'A,B'. Can you explain this answer?.
Solutions for Consider 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:a)9b)6c)8d)3Correct answer is option 'A,B'. Can you explain this answer? in English & in Hindi are available as part of our courses for Computer Science Engineering (CSE). Download more important topics, notes, lectures and mock test series for Computer Science Engineering (CSE) Exam by signing up for free.
Here you can find the meaning of Consider 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:a)9b)6c)8d)3Correct answer is option 'A,B'. Can you explain this answer? defined & explained in the simplest way possible. Besides giving the explanation of Consider 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:a)9b)6c)8d)3Correct answer is option 'A,B'. Can you explain this answer?, a detailed solution for Consider 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:a)9b)6c)8d)3Correct answer is option 'A,B'. Can you explain this answer? has been provided alongside types of Consider 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:a)9b)6c)8d)3Correct answer is option 'A,B'. Can you explain this answer? theory, EduRev gives you an ample number of questions to practice Consider 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:a)9b)6c)8d)3Correct answer is option 'A,B'. Can you explain this answer? tests, examples and also practice Computer Science Engineering (CSE) tests.
Explore Courses for Computer Science Engineering (CSE) exam

Top Courses for Computer Science Engineering (CSE)

Explore Courses
Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev