14 votes 14 votes The following page addresses, in the given sequence, were generated by a program: $\text{1 2 3 4 1 3 5 2 1 5 4 3 2 3}$ This program is run on a demand paged virtual memory system, with main memory size equal to $4$ pages. Indicate the page references for which page faults occur for the following page replacement algorithms. LRU FIFO Assume that the main memory is initially empty. Operating System gate1993 operating-system page-replacement normal descriptive + – Kathleen asked Sep 29, 2014 recategorized Apr 22, 2021 by Lakshman Bhaiya Kathleen 6.5k views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
Best answer 18 votes 18 votes LRU : $1,2,3,4,5,2,4,3,2$ FIFO : $1,2,3,4,5,1,2,3$ Digvijay Pandey answered Apr 26, 2015 edited Jun 28, 2018 by kenzou Digvijay Pandey comment Share Follow See all 2 Comments See all 2 2 Comments reply ਜਗਮੀਤ commented Jan 21, 2017 i edited by Lakshman Bhaiya Jan 6, 2019 reply Follow Share Also the number of page faults: LRU: 9 FIFO: 8 17 votes 17 votes Lakshman Bhaiya commented Jan 6, 2019 i edited by Lakshman Bhaiya Nov 19, 2019 reply Follow Share $(A)LRU:$ miss rate$=\dfrac{9}{14}$ $(B)FIFO:$ miss rate$=\dfrac{8}{14}$ 7 votes 7 votes Please log in or register to add a comment.
2 votes 2 votes LRU=9 1 2 3 4 1 3 5 2 1 5 4 3 2 3 4 4 4 4 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4 2 2 2 2 2 5 5 5 5 5 5 5 5 1 1 1 1 1 1 1 1 1 1 1 1 2 2 F F F F F F F F F FIFO=8 1 2 3 4 1 3 5 2 1 5 4 3 2 3 4 4 4 4 4 4 4 4 4 4 3 3 3 3 3 3 3 3 3 3 3 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 5 5 5 5 5 5 5 5 F F F F F F F F KUSHAGRA गुप्ता answered Jan 25, 2020 KUSHAGRA गुप्ता comment Share Follow See all 4 Comments See all 4 4 Comments reply Gaganjot _Kaur commented Jan 27, 2020 reply Follow Share @Kushagra गुप्ता Do we always count page faults right from the beginning or should we start counting once main memory frames are full? PS: The snapshot is from William Stallings, page-369 0 votes 0 votes KUSHAGRA गुप्ता commented Jan 27, 2020 reply Follow Share Difficult for me to comment anything on that as I am not sure. But if we go through PY questions on page replacement and follow the approach given in my answer we end up getting the right answer. I suggest that you might have started solving questions and if you find another question do apply both approach and see which is giving the right answer. And if you found that my approach is wrong do inform me. Thanks. 1 votes 1 votes vaibhavkedia968 commented Dec 1, 2020 reply Follow Share By the definition of page fault, we should start counting from the beginning instead of waiting for the memory frames to be full (unless otherwise specified in the question of course) 1 votes 1 votes ankit3009 commented Dec 11, 2021 reply Follow Share This might help : https://www.cs.utah.edu/~mflatt/past-courses/cs5460/lecture10.pdf 0 votes 0 votes Please log in or register to add a comment.