Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Please assist. Ensure accuracy. Thanks very much. #2. For a virtual memory syste

ID: 3856262 • Letter: P

Question

Please assist. Ensure accuracy. Thanks very much.

#2.

For a virtual memory system with 3 frames and 6 pages, work the page replacement for Optimal (future knowledge), FIFO, and LRU for the following stream of page references:

3,4,1,3,4,3,2,6,3,5,3,2,3,2,1,6,4,3,4,3,6,1,2

Optimal

stream

1

4

1

3

4

3

2

6

3

5

3

2

3

2

1

6

4

3

4

3

6

1

2

1

2

3

Faults

Total Faults

FIFO

stream

1

4

1

3

4

3

2

6

3

5

3

2

3

2

1

6

4

3

4

3

6

1

2

1

2

3

Faults

Total Faults

LRU

stream

1

4

1

3

4

3

2

6

3

5

3

2

3

2

1

6

4

3

4

3

6

1

2

1

2

3

Faults

Total Faults

Optimal

stream

1

4

1

3

4

3

2

6

3

5

3

2

3

2

1

6

4

3

4

3

6

1

2

1

2

3

Faults

Total Faults

Explanation / Answer

Optimal :-

It looks ahead in the input queue for the page frame which will be referenced only after a long time. The page with the longest reference is swapped.

Optimal

stream

1

4

1

3

4

3

2

6

3

5

3

2

3

2

1

6

4

3

4

3

6

1

2

1

1

1

1

1

1

1

1

6

6

5

5

5

5

5

1

1

4

4

4

4

4

1

1

2

4

4

4

4

4

2

2

2

2

2

2

2

2

2

6

6

6

6

6

6

2

3

3

3

3

3

3

3

3

3

3

3

3

3

3

3

3

3

3

3

3

3

Faults(*)

*

*

*

*

*

*

*

*

*

*

*

Total Faults

2

3

3

3

4

5

5

6

6

6

6

6

7

8

9

9

9

9

9

10

11

FIFO :-

when a page is needed to be replaced, we select the oldest page.

FIFO

stream

1

4

1

3

4

3

2

6

3

5

3

2

3

2

1

6

4

3

4

3

6

1

2

1

1

1

1

1

1

2

2

2

2

3

3

3

3

3

6

6

6

6

6

6

1

1

2

4

4

4

4

4

4

6

6

6

6

2

2

2

2

2

4

4

4

4

4

4

2

3

3

3

3

3

3

3

5

5

5

5

5

1

1

1

3

3

3

3

3

3

Faults

*

*

*

*

*

*

*

*

*

*

*

*

*

*

Total Faults

2

3

3

3

4

5

5

6

7

8

8

8

9

10

11

12

12

12

12

13

14

LRU :-

We replace the page which has not been referenced for a long time in the past.

LRU

stream

1

4

1

3

4

3

2

6

3

5

3

2

3

2

1

6

4

3

4

3

6

1

2

1

1

1

1

1

1

1

2

2

2

5

5

5

5

5

1

1

1

3

3

3

3

3

2

2

4

4

4

4

4

4

6

6

6

6

2

2

2

2

2

4

4

4

4

4

1

1

3

3

3

3

3

3

3

3

3

3

3

3

3

6

6

6

6

6

6

6

6

Faults

*

*

*

*

*

*

*

*

*

*

*

*

*

Total Faults

2

3

3

3

4

5

5

6

6

7

7

7

8

9

10

11

11

11

11

12

13

Optimal

stream

1

4

1

3

4

3

2

6

3

5

3

2

3

2

1

6

4

3

4

3

6

1

2

1

1

1

1

1

1

1

1

6

6

5

5

5

5

5

1

1

4

4

4

4

4

1

1

2

4

4

4

4

4

2

2

2

2

2

2

2

2

2

6

6

6

6

6

6

6

2

3

3

3

3

3

3

3

3

3

3

3

3

3

3

3

3

3

3

3

3

3

Faults(*)

*

*

*

*

*

*

*

*

*

*

*

Total Faults

2

3

3

3

4

5

5

6

6

6

6

6

7

8

9

9

9

9

9

10

11