Log In
3 votes
Self doubt:

What is the rule or keyb point we should keep in mind while solving problems on LRU page replacement algorithm? Please explain with examples.
in Operating System 170 views

1 Answer

2 votes
Best answer

My definition about LRU is Replace the page which one is Long-ago Used

1) no.of pages already loaded in the memory

              given reference string is 1,2,4,5,6,1,2,3..... using demand-paging said  that already two pages brought in main memory 1 ,2 and 1 is brought before 2


           in the reference string very first 1 and 2 are hits but not the page faults 

2) which page is long-ago used

            given reference string is 1,2,4,5,6,1,2,3..... think each reference is in different month first 1 is in jan, first 2 is in feb, 4 is in mar, 5 is in apr, 6 is in may, second 1 is June , second 2 is in July etc... if a hit occurs consider the page respective month is updated to new one ( 1 is June and 2 is July in this example ). if a page fault occurs replace the page with which have long-ago referred...

selected by

Related questions

1 vote
0 answers
if you have 10 Frames and using LRU how many page fault will be there in both below: for (int j = 0; j < 100; j++) for (int i = 0; i < 100; i++) A[i][j] = A[i][j] + A[j][i]; for (int i = 0; i < 100; i++) for (int j = 0; j < 100; j++) A[i][j] = A[i][j] + A[j][i];
asked Nov 13, 2017 in Operating System ashu0316 182 views
0 votes
1 answer
Determine the number of page faults when references to pages occur in the following order: $1,2,4,5,2,1,2,4$. Assume that the main memory can accommodate $3$ pages and the main memory already has the pages $1$ and $2$, with page $1$ having been brought earlier than page $2$.(LRU algorithm is used). $3$ $5$ $4$ None of these.
asked Mar 31 in Operating System Lakshman Patel RJIT 110 views
1 vote
1 answer
A system uses optimal policy for a page replacement. It has 4 page frames with no pages loaded to begin with. Consider the following scenario Case-1: System first accesses 200 distinct pages in sequential order and then access same 200 distinct pages in same ... and then access same 200 distinct page in reverse order. The difference in the number of faults occurred in both case are _________.
asked Jan 24, 2018 in Operating System _anu 133 views
1 vote
2 answers
Consider a demand paged memory system, page table is held in registers. It takes 800 nsec to service a page fault if empty page is available or replaced page is not modified and 950 nsec if the replaced page is modified, main memory access time is 120 nsec. If page to be replaced is modified 85% of time and page faultrate is 20% then average memory access time is ________. (Upto 1 decimal place)
asked Aug 14, 2018 in Operating System jhaanuj2108 597 views