Computer Science Engineering (CSE) Exam  >  Computer Science Engineering (CSE) Questions  >  All page frames are initially empty, and a pr... Start Learning for Free
All page frames are initially empty, and a process is allowed three page frames in memory, and references its pages in the order 1,2,3,2,4,5,2,3,2,2,4,1,5.
If the page replacement policy is optimal replacement policy, then page faults caused by this process is,
  • a)
    Six
  • b)
    Seven
  • c)
    Eight
  • d)
    Nine
Correct answer is option 'B'. Can you explain this answer?
Verified Answer
All page frames are initially empty, and a process is allowed three pa...
Optimal replacement policy looks forward in time to see which frame to replace on a page fault. Thus it is not a real replacement algorithm. It gives us a reference of number of frame for a given static frame access sequence.
2     HIT (page number 2 already in memory so there is no page faults.)
2     HIT
3     HIT
2     HIT
2     HIT
5     HIT
So there are 7 page faults
View all questions of this test
Most Upvoted Answer
All page frames are initially empty, and a process is allowed three pa...
Solution:

Optimal page replacement algorithm replaces the page which will not be used for the longest period of time in the future. It is an optimal algorithm because it replaces the page that will not be used for the longest period of time and hence reduces the number of page faults.

Given:

Page frames = 3

Pages referenced = 1,2,3,2,4,5,2,3,2,2,4,1,5

Total page faults = ?

Explanation:

Initially, all the page frames are empty, so the first three page references will cause page faults.

Step 1: 1
Page Fault = 1

Step 2: 2
Page Fault = 2

Step 3: 3
Page Fault = 3

Step 4: 2
Page Fault = 0 (No page fault as the page is already present in the memory)

Step 5: 4
Page Fault = 4

Step 6: 5
Page Fault = 5

Step 7: 2
Page Fault = 0 (No page fault as the page is already present in the memory)

Step 8: 3
Page Fault = 0 (No page fault as the page is already present in the memory)

Step 9: 2
Page Fault = 0 (No page fault as the page is already present in the memory)

Step 10: 2
Page Fault = 0 (No page fault as the page is already present in the memory)

Step 11: 4
Page Fault = 4

Step 12: 1
Page Fault = 1

Step 13: 5
Page Fault = 5

Total page faults = 7

Therefore, the total number of page faults caused by the process is 7.
Explore Courses for Computer Science Engineering (CSE) exam

Similar Computer Science Engineering (CSE) Doubts

Top Courses for Computer Science Engineering (CSE)

All page frames are initially empty, and a process is allowed three page frames in memory, and references its pages in the order 1,2,3,2,4,5,2,3,2,2,4,1,5.If the page replacement policy is optimal replacement policy, then page faults caused by this process is,a)Sixb)Sevenc)Eightd)NineCorrect answer is option 'B'. Can you explain this answer?
Question Description
All page frames are initially empty, and a process is allowed three page frames in memory, and references its pages in the order 1,2,3,2,4,5,2,3,2,2,4,1,5.If the page replacement policy is optimal replacement policy, then page faults caused by this process is,a)Sixb)Sevenc)Eightd)NineCorrect answer is option '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 All page frames are initially empty, and a process is allowed three page frames in memory, and references its pages in the order 1,2,3,2,4,5,2,3,2,2,4,1,5.If the page replacement policy is optimal replacement policy, then page faults caused by this process is,a)Sixb)Sevenc)Eightd)NineCorrect answer is option '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 All page frames are initially empty, and a process is allowed three page frames in memory, and references its pages in the order 1,2,3,2,4,5,2,3,2,2,4,1,5.If the page replacement policy is optimal replacement policy, then page faults caused by this process is,a)Sixb)Sevenc)Eightd)NineCorrect answer is option 'B'. Can you explain this answer?.
Solutions for All page frames are initially empty, and a process is allowed three page frames in memory, and references its pages in the order 1,2,3,2,4,5,2,3,2,2,4,1,5.If the page replacement policy is optimal replacement policy, then page faults caused by this process is,a)Sixb)Sevenc)Eightd)NineCorrect answer is option '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 All page frames are initially empty, and a process is allowed three page frames in memory, and references its pages in the order 1,2,3,2,4,5,2,3,2,2,4,1,5.If the page replacement policy is optimal replacement policy, then page faults caused by this process is,a)Sixb)Sevenc)Eightd)NineCorrect answer is option 'B'. Can you explain this answer? defined & explained in the simplest way possible. Besides giving the explanation of All page frames are initially empty, and a process is allowed three page frames in memory, and references its pages in the order 1,2,3,2,4,5,2,3,2,2,4,1,5.If the page replacement policy is optimal replacement policy, then page faults caused by this process is,a)Sixb)Sevenc)Eightd)NineCorrect answer is option 'B'. Can you explain this answer?, a detailed solution for All page frames are initially empty, and a process is allowed three page frames in memory, and references its pages in the order 1,2,3,2,4,5,2,3,2,2,4,1,5.If the page replacement policy is optimal replacement policy, then page faults caused by this process is,a)Sixb)Sevenc)Eightd)NineCorrect answer is option 'B'. Can you explain this answer? has been provided alongside types of All page frames are initially empty, and a process is allowed three page frames in memory, and references its pages in the order 1,2,3,2,4,5,2,3,2,2,4,1,5.If the page replacement policy is optimal replacement policy, then page faults caused by this process is,a)Sixb)Sevenc)Eightd)NineCorrect answer is option 'B'. Can you explain this answer? theory, EduRev gives you an ample number of questions to practice All page frames are initially empty, and a process is allowed three page frames in memory, and references its pages in the order 1,2,3,2,4,5,2,3,2,2,4,1,5.If the page replacement policy is optimal replacement policy, then page faults caused by this process is,a)Sixb)Sevenc)Eightd)NineCorrect answer is option '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