Consider the following page reference using four physical frames that are initially empty.
(a) (5 points) Find the page faults using LRU algorithm, where the page reference sequence: 5,2,5,1,4,5,2,0,4,2,3,1,2,1,0,0,2,4,5,1?
(b) (5 points) Find the page faults using FIFO algorithm, where the page reference sequence: 5,2,1,5,1,0,3,1,2,1,4,0,5,4, 2,3,3, 4,2,1?
(c) (5 points) Find the page faults using LRU algorithm, where the page reference sequence: 5, 0, 4, 4, 0, 3, 0, 4, 1, 0, 2, 0, 5, 3, 0, 1?
Consider the following page reference using four physical frames that are initially empty.
(a) Find the page faults using LRU algorithm, where the page reference sequence: 5,2,5,1,4,5,2,0,4,2,3,1,2,1,0,0,2,4,5,1?
ANSWER: (a)
The first row represents the page reference sequence
The cells with bold number denote page fault.
|
5 |
2 |
5 |
1 |
4 |
5 |
2 |
0 |
4 |
2 |
3 |
1 |
2 |
1 |
0 |
0 |
2 |
4 |
5 |
1 |
|
5 |
5 |
5 |
5 |
5 |
5 |
5 |
5 |
5 |
5 |
3 |
3 |
3 |
3 |
3 |
3 |
3 |
4 |
4 |
4 |
|
2 |
2 |
2 |
2 |
2 |
2 |
2 |
2 |
2 |
2 |
2 |
2 |
2 |
2 |
2 |
2 |
2 |
2 |
2 |
|
|
1 |
1 |
1 |
1 |
0 |
0 |
0 |
0 |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
5 |
5 |
|||
|
4 |
4 |
4 |
4 |
4 |
4 |
4 |
4 |
4 |
4 |
0 |
0 |
0 |
0 |
0 |
1 |
The number of page faults using LRU = 11
(b) Find the page faults using FIFO algorithm, where the page reference sequence: 5,2,1,5,1,0,3,1,2,1,4,0,5,4, 2,3,3, 4,2,1?
The first row represents the page reference sequence
The cells with bold number denote page fault.
ANSWER: (b)
|
5 |
2 |
1 |
5 |
1 |
0 |
3 |
1 |
2 |
1 |
4 |
0 |
5 |
4 |
2 |
3 |
3 |
4 |
2 |
1 |
|
5 |
5 |
5 |
5 |
5 |
5 |
3 |
3 |
3 |
3 |
3 |
3 |
3 |
3 |
3 |
3 |
3 |
3 |
3 |
1 |
|
2 |
2 |
2 |
2 |
2 |
2 |
2 |
2 |
2 |
4 |
4 |
4 |
4 |
4 |
4 |
4 |
4 |
4 |
4 |
|
|
1 |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
5 |
5 |
5 |
5 |
5 |
5 |
5 |
5 |
||
|
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
2 |
2 |
2 |
2 |
2 |
2 |
The number of page faults using FIFO = 9
(c) Find the page faults using LRU algorithm, where the page reference sequence: 5, 0, 4, 4, 0, 3, 0, 4, 1, 0, 2, 0, 5, 3, 0, 1?
ANSWER: (c)
The first row represents the page reference sequence
The cells with bold number denote page fault.
|
5 |
0 |
4 |
4 |
0 |
3 |
0 |
4 |
1 |
0 |
2 |
0 |
5 |
3 |
0 |
1 |
|
5 |
5 |
5 |
5 |
5 |
5 |
5 |
5 |
1 |
1 |
1 |
1 |
1 |
3 |
3 |
3 |
|
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
|
|
4 |
4 |
4 |
4 |
4 |
4 |
4 |
4 |
4 |
4 |
5 |
5 |
5 |
5 |
||
|
3 |
3 |
3 |
3 |
3 |
2 |
2 |
2 |
2 |
2 |
1 |
The number of page faults using LRU = 9
Method to find out page fault while using LRU page replacement:
1. For each page request in the reference sequence, check whether it is already there in one of the memory frames,
3. If yes, then continue with other pages in the reference sequence.
4. If no, insert it if there is a page frame available and consider a page fault.
5. If no page frame is available, then replace the least recently used one and consider a page fault.
Method to find out page fault while using FIFO page replacement:
1. For each page request in the reference sequence, check whether it is already there in one of the memory frames,
3. If yes, then continue with other pages in the reference sequence.
4. If no, insert it if there is a page frame available and consider a page fault.
5. If no page frame is available, then replace the first inserted one and consider a page fault.
Consider the following page reference using four physical frames that are initially empty. (a) (5 points)...
Consider the following virtual page reference sequence: page 1, 2, 3, 4, 2, 1, 5, 6, 2, 1, 2, 3. This indicates that these particular pages need to be accessed by the computer in the order shown. Consider each of the following 4 algorithm-frame combinations: LRU with 3 frames FIFO with 3 frames LRU with 4 frames FIFO with 4 frames . For each of the 4 combinations, below, move from left to right as the virtual page numbers are...
1. Consider a system where 3 page frames are allocated to a process. Consider the following sequence of memory references: 3 2 1 0 3 2 4 3 2 1 0 4. Assuming no pages are initially in memory, how many page faults are there assuming a FIFO page replacement algorithm is used? 2. Repeat problem 1 with number of frames increased to 4. 3. Compare the number of page faults from 1 and 2. Is there Belady’s anomaly? 4....
Consider the following page reference string: 1, 2, 3, 4, 2, 1, 5, 6, 2, 1, 2, 3, 7, 6, 3, 2, 1, 2, 3, 6. How many page faults would occur for the following replacement algorithms, assuming one, two, three, four, five, six, or seven frames? Remember all frames are initially empty, so your first unique pages will all cost one fault each. • LRU replacement • FIFO replacement • Optimal replacement
Given the following page-reference string, show the allocation of 3 frames of memory using FIFO , LRU and OPT. How many page faults for FIFO, LRU and OPT? 3,1,2,1,3,1,4,1,3,2,4,2,5,6,4,6,2,1,6,5
Consider the following page reference string, for a process with
5 virtual pages, and three frames in memory, and fill in the tables
for the LRU.
B. LRU. Reference string: ABCBDEABCDA Page Page Reference Fault Total Page Faults
9.3 (3 points for correct answer, 7 points for steps) Consider the following page reference string: 6, 1, 5, 5, 4, 6, 2, 6, 0 , 1, 7, 2, 3, 1, 4, 6, 7, 2, 5, 2,. Assuming demand paging with three frames, how many page faults would occur for the following replacement algorithms? • LRU replacement • FIFO replacement • Optimal replacement
Question 7 30 pts Consider the following page reference string: {1,2,3,4,1,5,6,2,1,2,3,7,6,3} Assume that the system has 4 page frames allocated to these 7 pages. Follow the page placement and replacement using the following three replacement algorithms: • LRU replacement • FIFO replacement • Optimal replacement How many page faults will occur for these three algorithms? Assume that all frames are initially empty, so your first unique pages will all cost one fault each USE ENCLOSED TABLES! Show all calculations in...
Consider the following sequence of page references 8, 5, 1, 8, 2, 5, 1, 4, 2, 3, 5, 3, 2, 8, 4. Assume that the memory has 3 frames which initially are free. What is the number of page faults using each of the following algorithms? a. FIFO b. LRU c. Clock d. Optimal
Consider the following page reference string: A C B D B A E F B F A G E F A Assuming demand paging with four frames, how many page faults would occur for the following replacement algorithms? Remember that all frames are initially empty, so your first unique pages will cost one fault each. Show all of your works. LRU replacement FIFO replacement Optimal (MIN) replacement
Consider the following page reference string: 1,2,3,4,7,1,5,6,2,1,4,3,2,1,2,3,6,7. How many page faults would occur for the LRU replacement algorithm, assuming FOUR frames for the working set?