Question

In: Computer Science

Find LRU paging A program has the following page reference string 0 1 2 3 3...

Find LRU paging

A program has the following page reference string 0 1 2 3 3 4 2 4 5 3 3 4 6 2 5 6 If we allocate 3 page frames to the program, 1. Please draw a figure to show the page allocation/replacement. 2. How many page faults will be generated?

Solutions

Expert Solution

1. Page allocation/replacement:

2. Total page fault:

  • Initially, all page slots are empty.
  • So, 012 is allocated to the empty slots -> 3-page faults.
  • When 3 comes, it replaces 0. Because it is least recently used.So 1-page fault.
  • Again 3 comes. It is already there. So 0-page fault.
  • Then 4 comes. It replaces 1 which is least recently used. So 1-page fault.
  • Then 2 comes, it is already there. So 0-page fault.
  • Then 4 comes. It is already there. So 0-page fault.
  • Then 5 comes. It replaces 3 which least recently used. So 1-page fault.
  • Then 3 comes, it replaces 2 which least recently used. So 1-page fault.
  • Then for the next 3 and 4, it is already there, so no page fault.
  • Then 6 comes. It replaces 5 which is least recently used. So 1-page fault.
  • Then 2 comes. It replaces 3 which is least recently used. So 1-page fault.
  • Then 5 comes. It replaces 4 which least recently used. So 1-page fault.
  • Then 6 comes. It is already there. So 0-page fault.
  • So total page fault = 3 + 1 + 1 + 1 + 1 + 1 + 1 + 1 =10






Related Solutions

Consider the following page reference string: 0, 1, 2, 3, 1, 0, 4, 5, 1, 0,...
Consider the following page reference string: 0, 1, 2, 3, 1, 0, 4, 5, 1, 0, 1, 2, 6, 5, 2, 1, 0, 1, 2, 5 How many page faults would occur for the following replacement algorithms, assuming one, three, five, and seven frames? Remember that all frames are initially empty, so your first unique pages will cost one fault each. Optimal replacement LRU replacement CLOCK replacement FIFO replacement
The following page-reference string: 1, 2, 4, 3, 2, 5, 4, 2, 4, 2, 1, 3,...
The following page-reference string: 1, 2, 4, 3, 2, 5, 4, 2, 4, 2, 1, 3, 2, 3, 1, 3, 6, 1, 6, 4. Main memory with 3 frames of 1 kilobyte available and they are all initially empty. Complete a figure, similar to Figure 8.14(in the slides or textbook), showing the frame allocation for each of the following page replacement policies: a. Optimal b. Least recently used c. First-in-first-out Then, find the relative performance of each policy with respect...
Page Replacement Algorithms. Consider the following page reference stream and 3 page frames: 0 1 2...
Page Replacement Algorithms. Consider the following page reference stream and 3 page frames: 0 1 2 3 2 4 3 1 1 5 2 4 6 3 3 4 6 3 4 7. For the MIN, FIFO, and LRU algorithms, show the contents of the page frame after each reference, and then compute the total number of page faults, divided in to cold misses and other misses.
reference string 0123342453346256 If we allocate 3 page frames to the program, 1. Please draw a...
reference string 0123342453346256 If we allocate 3 page frames to the program, 1. Please draw a figure to show the LRU page allocation/replacement \. 2. How many page faults will be generated?
Write a 1-2-page paper (not including title page and reference page) that describes the following: Ø...
Write a 1-2-page paper (not including title page and reference page) that describes the following: Ø You are caring for a patient with c-diff as part of your workload assignment. Discuss what c-diff is and how it is transmitted (how you can get it)? Ø What actions will you take as a nurse to protect yourself and the other patients on the unit when taking care of your patient? You should include a minimum of 3 scholarly references (suggestion on...
Write a 1-2-page paper (not including title page and reference page) that describes the following: Ø...
Write a 1-2-page paper (not including title page and reference page) that describes the following: Ø You are caring for a patient with c-diff as part of your workload assignment. Discuss what c-diff is and how it is transmitted (how you can get it)? Ø What actions will you take as a nurse to protect yourself and the other patients on the unit when taking care of your patient? You should include a minimum of 3 scholarly references (suggestion on...
Find the inverse of the matrix A= 2 -1 3 0 1 1 -1 -1 0
Find the inverse of the matrix A= 2 -1 3 0 1 1 -1 -1 0
Complete a 2-3-page paper with an abstract and conclusion (plus cover sheet and reference page) that...
Complete a 2-3-page paper with an abstract and conclusion (plus cover sheet and reference page) that discusses: 1. How does a cloud based storage service differ from Software as a Service (SaaS)? 2. Give a brief overview of the following types of cloud based storage (Public, Private, Hybrid and Mobile). 3. What are the disadvantages and advantages to using cloud based storage? 4. What are the availability, performance, and security considerations? Specific questions or items to address: 1. How does...
Write an essay (2 pages + 1 reference page = 3 pages total) on your assigned...
Write an essay (2 pages + 1 reference page = 3 pages total) on your assigned patient Must have 2 or more references . Your patient is a 45year old female with a medical diagnosis of Hypertension. She has a MD order for Blood Pressure checks every 4 hours (q4h).      A. Name and describe 2 sites and 2 ways (types) to measure her Blood Pressure. (20pts)      B. What are some of the factors that affect Blood Pressure?                       (25...
Let A = 0 2 0 1 0 2 0 1 0 . (a) Find the...
Let A = 0 2 0 1 0 2 0 1 0 . (a) Find the eigenvalues of A and bases of the corresponding eigenspaces. (b) Which of the eigenspaces is a line through the origin? Write down two vectors parallel to this line. (c) Find a plane W ⊂ R 3 such that for any w ∈ W one has Aw ∈ W , or explain why such a plain does not exist. (d) Write down explicitly a diagonalizing...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT