0% found this document useful (0 votes)
46 views2 pages

9 Solved Example 2

The document presents a comparison of three page replacement methods: FIFO, LRU, and OPT, applied to a sequence of page references with a frame size of 3. FIFO resulted in 5 hits and 15 page faults, LRU achieved 8 hits and 12 page faults, while OPT had the best performance with 11 hits and 9 page faults. The hit rates for FIFO, LRU, and OPT were 25.0%, 40.0%, and 55.0% respectively.

Uploaded by

factflare068
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
46 views2 pages

9 Solved Example 2

The document presents a comparison of three page replacement methods: FIFO, LRU, and OPT, applied to a sequence of page references with a frame size of 3. FIFO resulted in 5 hits and 15 page faults, LRU achieved 8 hits and 12 page faults, while OPT had the best performance with 11 hits and 9 page faults. The hit rates for FIFO, LRU, and OPT were 25.0%, 40.0%, and 55.0% respectively.

Uploaded by

factflare068
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Sequence: 7 0 1 2 0 3 0 4 2 3 0 3 2 1 2 0 1 7 0 1

Frame Size: 3

Number of References: 20

Blue is the sequence

Red is the replaced value when page fault occurs

Method 1: First In First Out (FIFO)

7 0 1 2 0 3 0 4 2 3 0 3 2 1 2 0 1 7 0 1

7 7 7 2 2 2 2 4 4 4 0 0 0 0 0 0 0 7 7 7

- 0 0 0 0 3 3 3 2 2 2 2 2 1 1 1 1 1 0 0

- - 1 1 1 1 0 0 0 3 3 3 3 3 2 2 2 2 2 1

Number of Hits: 5

Page Faults: 15

Hit Rate: 25.0%

Method 2: Least Recently Used (LRU)

7 0 1 2 0 3 0 4 2 3 0 3 2 1 2 0 1 7 0 1

7 7 7 0 1 2 2 3 0 4 2 2 0 3 3 1 2 0 1 7

- 0 0 1 2 0 3 0 4 2 3 0 3 2 1 2 0 1 7 0

- - 1 2 0 3 0 4 2 3 0 3 2 1 2 0 1 7 0 1
Number of Hits: 8

Page Faults: 12

Hit Rate: 40.0%

Method 3: Optimal Page Replacement (OPT)

7 0 1 2 0 3 0 4 2 3 0 3 2 1 2 0 1 7 0 1

7 7 7 2 2 2 2 2 2 2 2 2 2 2 2 2 2 7 7 7

- 0 0 0 0 0 0 4 4 4 0 0 0 0 0 0 0 0 0 0

- - 1 1 1 3 3 3 3 3 3 3 3 1 1 1 1 1 1 1

Number of Hits: 11

Page Faults: 9

Hit Rate: 55.0%

You might also like