GATE Exam  >  GATE Questions  >  Consider the virtual page reference string1, ... Start Learning for Free
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 has main memory
size of 3 page frames which are initially empty. Let LRU, FIFO and OPTIMAL denote the number
of page faults under the corresponding page replacement policy. Then
  • a)
    OPTIMAL < LRU < FIFO
  • b)
    OPTIMAL < FIFO < LRU
  • c)
    OPTIMAL = LRU
  • d)
    OPTIMAL = FIFO
Correct answer is option 'B'. Can you explain this answer?
Verified Answer
Consider the virtual page reference string1, 2, 3, 2, 4, 1, 3, 2, 4, 1...
FIFO
1 1 1 4 4 4
2 2 2 1 1
3 3 3 2                           → (6) faults
Optimal
1 1 1 1 1
2 2 4 4
3 3 2                               → (5) faults
LRU
1 1 1 4 4 4 2 2 2
2 2 2 2 3 3 3 1
3 3 1 1 1 4 4                    → (9) faults
Optimal < FIFO < LRU
View all questions of this test
Most Upvoted Answer
Consider the virtual page reference string1, 2, 3, 2, 4, 1, 3, 2, 4, 1...
The OPTIMAL page replacement policy selects the page that will not be used for the longest period of time in the future. To determine the number of page faults under OPTIMAL, we need to analyze the page reference string and determine which pages will be needed in the future.

The page reference string is:
1, 2, 3, 2, 4, 1, 3, 2, 4, 1

Initially, all page frames are empty. Let's analyze the page reference string step by step:

1. Page 1 is referenced. It is not in memory, so a page fault occurs. The page frame is filled with page 1.

2. Page 2 is referenced. It is not in memory, so a page fault occurs. The page frame is filled with page 2.

3. Page 3 is referenced. It is not in memory, so a page fault occurs. The page frame is filled with page 3.

4. Page 2 is referenced again. It is already in memory, so no page fault occurs.

5. Page 4 is referenced. It is not in memory, so a page fault occurs. The page frame is filled with page 4.

6. Page 1 is referenced again. It is already in memory, so no page fault occurs.

7. Page 3 is referenced again. It is already in memory, so no page fault occurs.

8. Page 2 is referenced again. It is already in memory, so no page fault occurs.

9. Page 4 is referenced again. It is already in memory, so no page fault occurs.

10. Page 1 is referenced again. It is already in memory, so no page fault occurs.

In total, there are 3 page faults under the OPTIMAL page replacement policy.
Explore Courses for GATE exam
Consider the virtual page reference string1, 2, 3, 2, 4, 1, 3, 2, 4, 1on a demand paged virtual memory system running on a computer system that has main memorysize of 3 page frames which are initially empty. Let LRU, FIFO and OPTIMAL denote the numberof page faults under the corresponding page replacement policy. Thena)OPTIMAL < LRU < FIFOb)OPTIMAL < FIFO < LRUc)OPTIMAL = LRUd)OPTIMAL = FIFOCorrect answer is option 'B'. Can you explain this answer?
Question Description
Consider the virtual page reference string1, 2, 3, 2, 4, 1, 3, 2, 4, 1on a demand paged virtual memory system running on a computer system that has main memorysize of 3 page frames which are initially empty. Let LRU, FIFO and OPTIMAL denote the numberof page faults under the corresponding page replacement policy. Thena)OPTIMAL < LRU < FIFOb)OPTIMAL < FIFO < LRUc)OPTIMAL = LRUd)OPTIMAL = FIFOCorrect answer is option 'B'. Can you explain this answer? for GATE 2024 is part of GATE preparation. The Question and answers have been prepared according to the GATE exam syllabus. Information about Consider the virtual page reference string1, 2, 3, 2, 4, 1, 3, 2, 4, 1on a demand paged virtual memory system running on a computer system that has main memorysize of 3 page frames which are initially empty. Let LRU, FIFO and OPTIMAL denote the numberof page faults under the corresponding page replacement policy. Thena)OPTIMAL < LRU < FIFOb)OPTIMAL < FIFO < LRUc)OPTIMAL = LRUd)OPTIMAL = FIFOCorrect answer is option 'B'. Can you explain this answer? covers all topics & solutions for GATE 2024 Exam. Find important definitions, questions, meanings, examples, exercises and tests below for Consider the virtual page reference string1, 2, 3, 2, 4, 1, 3, 2, 4, 1on a demand paged virtual memory system running on a computer system that has main memorysize of 3 page frames which are initially empty. Let LRU, FIFO and OPTIMAL denote the numberof page faults under the corresponding page replacement policy. Thena)OPTIMAL < LRU < FIFOb)OPTIMAL < FIFO < LRUc)OPTIMAL = LRUd)OPTIMAL = FIFOCorrect answer is option 'B'. Can you explain this answer?.
Solutions for Consider the virtual page reference string1, 2, 3, 2, 4, 1, 3, 2, 4, 1on a demand paged virtual memory system running on a computer system that has main memorysize of 3 page frames which are initially empty. Let LRU, FIFO and OPTIMAL denote the numberof page faults under the corresponding page replacement policy. Thena)OPTIMAL < LRU < FIFOb)OPTIMAL < FIFO < LRUc)OPTIMAL = LRUd)OPTIMAL = FIFOCorrect answer is option 'B'. Can you explain this answer? in English & in Hindi are available as part of our courses for GATE. Download more important topics, notes, lectures and mock test series for GATE Exam by signing up for free.
Here you can find the meaning of Consider the virtual page reference string1, 2, 3, 2, 4, 1, 3, 2, 4, 1on a demand paged virtual memory system running on a computer system that has main memorysize of 3 page frames which are initially empty. Let LRU, FIFO and OPTIMAL denote the numberof page faults under the corresponding page replacement policy. Thena)OPTIMAL < LRU < FIFOb)OPTIMAL < FIFO < LRUc)OPTIMAL = LRUd)OPTIMAL = FIFOCorrect answer is option 'B'. Can you explain this answer? defined & explained in the simplest way possible. Besides giving the explanation of Consider the virtual page reference string1, 2, 3, 2, 4, 1, 3, 2, 4, 1on a demand paged virtual memory system running on a computer system that has main memorysize of 3 page frames which are initially empty. Let LRU, FIFO and OPTIMAL denote the numberof page faults under the corresponding page replacement policy. Thena)OPTIMAL < LRU < FIFOb)OPTIMAL < FIFO < LRUc)OPTIMAL = LRUd)OPTIMAL = FIFOCorrect answer is option 'B'. Can you explain this answer?, a detailed solution for Consider the virtual page reference string1, 2, 3, 2, 4, 1, 3, 2, 4, 1on a demand paged virtual memory system running on a computer system that has main memorysize of 3 page frames which are initially empty. Let LRU, FIFO and OPTIMAL denote the numberof page faults under the corresponding page replacement policy. Thena)OPTIMAL < LRU < FIFOb)OPTIMAL < FIFO < LRUc)OPTIMAL = LRUd)OPTIMAL = FIFOCorrect answer is option 'B'. Can you explain this answer? has been provided alongside types of Consider the virtual page reference string1, 2, 3, 2, 4, 1, 3, 2, 4, 1on a demand paged virtual memory system running on a computer system that has main memorysize of 3 page frames which are initially empty. Let LRU, FIFO and OPTIMAL denote the numberof page faults under the corresponding page replacement policy. Thena)OPTIMAL < LRU < FIFOb)OPTIMAL < FIFO < LRUc)OPTIMAL = LRUd)OPTIMAL = FIFOCorrect answer is option 'B'. Can you explain this answer? theory, EduRev gives you an ample number of questions to practice Consider the virtual page reference string1, 2, 3, 2, 4, 1, 3, 2, 4, 1on a demand paged virtual memory system running on a computer system that has main memorysize of 3 page frames which are initially empty. Let LRU, FIFO and OPTIMAL denote the numberof page faults under the corresponding page replacement policy. Thena)OPTIMAL < LRU < FIFOb)OPTIMAL < FIFO < LRUc)OPTIMAL = LRUd)OPTIMAL = FIFOCorrect answer is option 'B'. Can you explain this answer? tests, examples and also practice GATE tests.
Explore Courses for GATE exam
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