0% found this document useful (0 votes)
0 views3 pages

Page Replacement Algorithms Answer Key Formatted

The document discusses various page replacement algorithms used in operating systems, including FIFO, LRU, Optimal, LFU, and MRU, detailing their mechanisms and providing examples. It includes a comparison table highlighting the advantages and disadvantages of each algorithm. The conclusion emphasizes the importance of efficient memory management and notes that while Optimal is ideal, LRU is more commonly implemented in practice.
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)
0 views3 pages

Page Replacement Algorithms Answer Key Formatted

The document discusses various page replacement algorithms used in operating systems, including FIFO, LRU, Optimal, LFU, and MRU, detailing their mechanisms and providing examples. It includes a comparison table highlighting the advantages and disadvantages of each algorithm. The conclusion emphasizes the importance of efficient memory management and notes that while Optimal is ideal, LRU is more commonly implemented in practice.
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
You are on page 1/ 3

Engineering End Semester Examination

– Valuation Answer Key


Subject: Operating Systems

Question Type: 16 Marks

Question: Describe various page replacement algorithms with examples.

1. Introduction to Page Replacement (2 Marks)


- Page replacement occurs when a page fault happens and there are no free frames.
- The operating system must select a page to remove to load the new page.

2. Page Replacement Algorithms (10 Marks)

i. First-In First-Out (FIFO) (2 Marks)


- Replaces the oldest page in memory.
- Simple to implement.
Example (Page reference string: 1, 2, 3, 1, 4, 5; 3 frames):
1 → [1]
2 → [1, 2]
3 → [1, 2, 3]
1 → Hit
4 → Replace 1 → [4, 2, 3]
5 → Replace 2 → [4, 5, 3]
Page Faults = 5

ii. Least Recently Used (LRU) (2 Marks)


- Replaces the page that has not been used for the longest time.
Example (Page reference string: 1, 2, 3, 1, 4, 5; 3 frames):
1 → [1]
2 → [1, 2]
3 → [1, 2, 3]
1 → Hit
4 → Replace 2 → [1, 4, 3]
5 → Replace 3 → [1, 4, 5]
Page Faults = 5

iii. Optimal Page Replacement (2 Marks)


- Replaces the page that will not be used for the longest time in future.
- Theoretical best.
Example (Page reference string: 7, 0, 1, 2, 0, 3, 0, 4; 3 frames):
7 → [7]
0 → [7, 0]
1 → [7, 0, 1]
2 → Replace 7 → [2, 0, 1]
0 → Hit
3 → Replace 1 → [2, 0, 3]
0 → Hit
4 → Replace 2 → [4, 0, 3]
Page Faults = 6

iv. LFU & MRU (2 Marks)


- LFU (Least Frequently Used): Replaces the page with lowest access count.
- MRU (Most Recently Used): Replaces the most recently accessed page.
- Useful in specific workloads but not always efficient.

3. Comparison Table (2 Marks)


Algorithm Basis Advantage Disadvantage

FIFO Oldest page Simple May remove


frequently used
pages

LRU Least recently used Better than FIFO Needs tracking

Optimal Future access Minimum page Not practical


faults

LFU Access frequency Good for repeated Expensive to


use maintain counters

MRU Recent access Efficient in few Poor in general use


cases

4. Conclusion (2 Marks)
- Page replacement is crucial in managing memory efficiently in virtual memory systems.
- Optimal is ideal but impractical. LRU is widely used in real-world systems.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy