Anonymous user menu

Page Replacement Algorithms

Consider two possible page-replacement strategies: LRU (the least recently used page is replaced) and FIFO (the page that has been in memory longest is replaced). Assume that, after space has been reserved for the page table, the interrupt service routines, and the operating system kernel, there is only sufficient room left in the main memory for four user program pages. Assume also that initially virtual pages 1, 2, 3, and 4 of the user program are brought into physical memory in that order.
For each of the two strategies, what pages will be in the memory at the end of the following sequence of virtual page accesses? Read the sequence from left to right: (6, 3, 2, 8, 4)

(A) 4, 8, 2, 3 and 8, 6, 4, 3 respectively
(B) 8, 6, 4, 3 and 4, 8, 2, 3 respectively
(C) 8, 6, 4, 2 and 4, 2, 8, 3 respectively
(D) None of these

Answer

Discuss

3Comments
pragya goyal @pragya
13 Jun 2017 02:31 pm

c

Sumit Verma @sumitverma
13 Jun 2017 03:19 pm

@pragya in LRU, 6 will not be in memory at the end and in FIFO, 2 will not be there.
So Option C is not correct. Give it a try again.

pragya goyal @pragya
13 Jun 2017 03:51 pm

ya.. It would be A.