SlideShare a Scribd company logo
4
Most read
7
Most read
10
Most read
PAGE REPLACEMENT
ALGORITHMS
(FIFO/LRU/OPT)
A PRESENTATION BY ARIJIT ROY
COMPUTER SCIENCE & ENGG. DEPT., 2ND YEAR
HOOGHLY ENGINEERING & TECHNOLOGY COLLEGE
FIFO PAGE REPLACEMENT ALGORITHM
Suppose, all the page frames are filled with
different pages.
Now a new page request occurs.
This required page is not present in any
frame.
Then the page which came first, that will
swap out from the frame.
New page will swap in to that empty frame.
Q. Suppose there are page requests 5,2,3,2,7,1,3,4,5,1.
Assume there are 3 frames in RAM. Show the page
replacement by FIFO algorithm and calculate – number of
page hits and page faults, Hit ratio and miss ratio.
5 2 3 2 7 1 3 4 5 1
Q. Suppose there are page requests 5,2,3,2,7,1,3,4,5,1.
Assume there are 3 frames in RAM. Show the page
replacement by FIFO algorithm and calculate – number of
page hits and page faults, Hit ratio and miss ratio.
5 2 3 2 7 1 3 4 5 1
5 5
2
5
2
3
5
2
3
7
2
3
7
1
3 3
1
7 7
1
4 4
1
5 5
1
4
Page Hit Page Fault
No. of Page Hit = 3
No. of Page Fault = 7
 Hit Ratio = (No.
of Page Hit /
Total Pages) =
3/10
 Miss Ratio =
(No. of Page
Fault / Total
Pages) = 1- Hit
Ratio = 7/10
LRU PAGE REPLACEMENT ALGORITHM
Suppose, all the page frames are filled with
different pages.
Now a new page request occurs.
This required page is not present in any
frame.
Then the page which is least recently used
that will swap out.
New page will swap in to that empty frame.
Q. Suppose there are page requests 2,3,1,2,4,1,6,2,5,4.
Assume there are 3 frames in RAM. Show the page
replacement by LRU algorithm and calculate – number of
page hits and page faults, Hit ratio and miss ratio.
2 3 1 2 4 1 6 2 5 4
Q. Suppose there are page requests 2,3,1,2,4,1,6,2,5,4.
Assume there are 3 frames in RAM. Show the page
replacement by LRU algorithm and calculate – number of
page hits and page faults, Hit ratio and miss ratio.
2 3 1 2 4 1 6 2 5 4
2 2 2 2 2 2 6 6 6 4
2
55111111
3 3 3 4 4 4 2 2
No. of Page Hit = 2
No. of Page Fault = 8
 Hit Ratio = (No.
of Page Hit /
Total Pages) =
2/10 = 1/5
 Miss Ratio = (No.
of Page Fault /
Total Pages) = 1 –
Hit Ratio = 8/10 =
4/5Page Hit Page Fault
OPTIMAL PAGE REPLACEMENT ALGORITHM
Suppose, all the page frames are filled with
different pages.
Now a new page request occurs.
This required page is not present in any
frame.
Then the page which is used most later that
will swap out.
New page will swap in to that empty frame.
Q. Suppose there are page requests 2,1,5,3,4,2,5,1,2,5.
Assume there are 3 frames in RAM. Show the page
replacement by Optimal page replacement algorithm and
calculate – number of page hits and page faults, Hit ratio and
miss ratio.
2 1 5 3 4 2 5 1 2 5
Q. Suppose there are page requests 2,1,5,3,4,2,5,1,2,5.
Assume there are 3 frames in RAM. Show the page
replacement by Optimal page replacement algorithm and
calculate – number of page hits and page faults, Hit ratio and
miss ratio.
2 1 5 3 4 2 5 1 2 5
Page FaultPage Hit
2 2
1
5
2
1
5
2
3
5
4
2 2
4
5
2
4
5
2
1
5
2
1
5
2
1
5
3 is not present. So it will use in far future.4 is not present. So it will use in further future.
No. of Page Hit = 4
No. of Page Fault = 6
 Hit Ratio = (No.
of Page Hit /
Total Pages) =
4/10 = 2/5
 Miss Ratio = (No.
of Page Fault /
Total Pages) = 1 –
Hit Ratio = 6/10 =
3/5
THAT’S ALL FOR THE DAY
There is a set of problems from this algorithms
are already given. You can download it from the
link given below.
Link - https://drive.google.com/open?id=10kDzksl-
aaPcAESSTB3f30nnxBDhftvL
Link is also given in description box.
You can mail me the answer sheet on
byte2bytelearn@gmail.com
HOPE YOU GUYS ENJOY THIS SLIDE.
SEE YOU IN THE NEXT VIDEO.
STAY HOME, STAY SAFE.

More Related Content

PPTX
Structure of the page table
DOCX
Amdahl`s law -Processor performance
PPTX
Fragmentaton
PPTX
Page replacement algorithms
PPTX
Swapping | Computer Science
PPTX
Demand paging
PPT
Thrashing allocation frames.43
PPS
Virtual memory
Structure of the page table
Amdahl`s law -Processor performance
Fragmentaton
Page replacement algorithms
Swapping | Computer Science
Demand paging
Thrashing allocation frames.43
Virtual memory

What's hot (20)

PPTX
Page Replacement Algorithms
PPTX
Auxiliary memory
PPTX
Virtual memory ppt
PPTX
Presentation on Segmentation
PPTX
Virtual Memory
PPT
Disk scheduling
DOCX
Parallel searching
PDF
Interconnection Network
PDF
Cache optimization
PPT
Clustering: Large Databases in data mining
PPTX
Overview of physical storage media
PPT
Chapter 9 - Virtual Memory
PPT
Page Replacement
PPTX
Demand paging
PPTX
Learning in AI
PPTX
Thread scheduling...................pptx
PPTX
Oop’s Concept and its Real Life Applications
PPTX
Disk Scheduling Algorithm in Operating System
PDF
CSI-503 - 10. Security & Protection (Operating System)
PDF
Token, Pattern and Lexeme
Page Replacement Algorithms
Auxiliary memory
Virtual memory ppt
Presentation on Segmentation
Virtual Memory
Disk scheduling
Parallel searching
Interconnection Network
Cache optimization
Clustering: Large Databases in data mining
Overview of physical storage media
Chapter 9 - Virtual Memory
Page Replacement
Demand paging
Learning in AI
Thread scheduling...................pptx
Oop’s Concept and its Real Life Applications
Disk Scheduling Algorithm in Operating System
CSI-503 - 10. Security & Protection (Operating System)
Token, Pattern and Lexeme
Ad

Similar to FIFO, LRU, OPTIMAL Page Replacement Algorithm (20)

PDF
Pge Replacement Algorithm.pdf
PPTX
Page replacement algorithms
PPTX
Page replacement algorithm
PPTX
page replacement.pptx
PPT
Pagereplacement algorithm(computional concept)
PPT
Page replacement
PPTX
Page replacement
PPT
42 lru optimal
PPTX
3_page_replacement_algorithms computer system and architecture
PPTX
PPTX
Page replacement algorithm
PPT
9415070 deepak kumar raja kumar hgdxgfgcg
DOCX
Chosse a best algorithm for page replacement to reduce page fault and analysi...
PDF
Hybrid Page Replacement Algorithm
PPTX
operating system notes about virtual memory 4.pptx
PPT
Replacement.ppt operating system in BCA cu
PPT
Explain about replacement algorithms from these slides
PDF
final_unit_6_spos_notes_2023/24 pattern.pdf
PPTX
Virtual memory management in Operating System
PDF
An input enhancement technique to maximize the performance of page replacemen...
Pge Replacement Algorithm.pdf
Page replacement algorithms
Page replacement algorithm
page replacement.pptx
Pagereplacement algorithm(computional concept)
Page replacement
Page replacement
42 lru optimal
3_page_replacement_algorithms computer system and architecture
Page replacement algorithm
9415070 deepak kumar raja kumar hgdxgfgcg
Chosse a best algorithm for page replacement to reduce page fault and analysi...
Hybrid Page Replacement Algorithm
operating system notes about virtual memory 4.pptx
Replacement.ppt operating system in BCA cu
Explain about replacement algorithms from these slides
final_unit_6_spos_notes_2023/24 pattern.pdf
Virtual memory management in Operating System
An input enhancement technique to maximize the performance of page replacemen...
Ad

Recently uploaded (20)

PDF
R24 SURVEYING LAB MANUAL for civil enggi
PPTX
Safety Seminar civil to be ensured for safe working.
PDF
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
PPTX
Internet of Things (IOT) - A guide to understanding
PDF
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
DOCX
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
PPTX
UNIT-1 - COAL BASED THERMAL POWER PLANTS
PDF
Embodied AI: Ushering in the Next Era of Intelligent Systems
PDF
Well-logging-methods_new................
PDF
Unit I ESSENTIAL OF DIGITAL MARKETING.pdf
PDF
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
PPTX
Artificial Intelligence
PDF
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
PPTX
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
PDF
composite construction of structures.pdf
PPT
introduction to datamining and warehousing
PPTX
UNIT 4 Total Quality Management .pptx
PDF
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
PPTX
CH1 Production IntroductoryConcepts.pptx
R24 SURVEYING LAB MANUAL for civil enggi
Safety Seminar civil to be ensured for safe working.
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
Internet of Things (IOT) - A guide to understanding
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
UNIT-1 - COAL BASED THERMAL POWER PLANTS
Embodied AI: Ushering in the Next Era of Intelligent Systems
Well-logging-methods_new................
Unit I ESSENTIAL OF DIGITAL MARKETING.pdf
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
Artificial Intelligence
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
composite construction of structures.pdf
introduction to datamining and warehousing
UNIT 4 Total Quality Management .pptx
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
CH1 Production IntroductoryConcepts.pptx

FIFO, LRU, OPTIMAL Page Replacement Algorithm

  • 1. PAGE REPLACEMENT ALGORITHMS (FIFO/LRU/OPT) A PRESENTATION BY ARIJIT ROY COMPUTER SCIENCE & ENGG. DEPT., 2ND YEAR HOOGHLY ENGINEERING & TECHNOLOGY COLLEGE
  • 2. FIFO PAGE REPLACEMENT ALGORITHM Suppose, all the page frames are filled with different pages. Now a new page request occurs. This required page is not present in any frame. Then the page which came first, that will swap out from the frame. New page will swap in to that empty frame.
  • 3. Q. Suppose there are page requests 5,2,3,2,7,1,3,4,5,1. Assume there are 3 frames in RAM. Show the page replacement by FIFO algorithm and calculate – number of page hits and page faults, Hit ratio and miss ratio. 5 2 3 2 7 1 3 4 5 1
  • 4. Q. Suppose there are page requests 5,2,3,2,7,1,3,4,5,1. Assume there are 3 frames in RAM. Show the page replacement by FIFO algorithm and calculate – number of page hits and page faults, Hit ratio and miss ratio. 5 2 3 2 7 1 3 4 5 1 5 5 2 5 2 3 5 2 3 7 2 3 7 1 3 3 1 7 7 1 4 4 1 5 5 1 4 Page Hit Page Fault No. of Page Hit = 3 No. of Page Fault = 7  Hit Ratio = (No. of Page Hit / Total Pages) = 3/10  Miss Ratio = (No. of Page Fault / Total Pages) = 1- Hit Ratio = 7/10
  • 5. LRU PAGE REPLACEMENT ALGORITHM Suppose, all the page frames are filled with different pages. Now a new page request occurs. This required page is not present in any frame. Then the page which is least recently used that will swap out. New page will swap in to that empty frame.
  • 6. Q. Suppose there are page requests 2,3,1,2,4,1,6,2,5,4. Assume there are 3 frames in RAM. Show the page replacement by LRU algorithm and calculate – number of page hits and page faults, Hit ratio and miss ratio. 2 3 1 2 4 1 6 2 5 4
  • 7. Q. Suppose there are page requests 2,3,1,2,4,1,6,2,5,4. Assume there are 3 frames in RAM. Show the page replacement by LRU algorithm and calculate – number of page hits and page faults, Hit ratio and miss ratio. 2 3 1 2 4 1 6 2 5 4 2 2 2 2 2 2 6 6 6 4 2 55111111 3 3 3 4 4 4 2 2 No. of Page Hit = 2 No. of Page Fault = 8  Hit Ratio = (No. of Page Hit / Total Pages) = 2/10 = 1/5  Miss Ratio = (No. of Page Fault / Total Pages) = 1 – Hit Ratio = 8/10 = 4/5Page Hit Page Fault
  • 8. OPTIMAL PAGE REPLACEMENT ALGORITHM Suppose, all the page frames are filled with different pages. Now a new page request occurs. This required page is not present in any frame. Then the page which is used most later that will swap out. New page will swap in to that empty frame.
  • 9. Q. Suppose there are page requests 2,1,5,3,4,2,5,1,2,5. Assume there are 3 frames in RAM. Show the page replacement by Optimal page replacement algorithm and calculate – number of page hits and page faults, Hit ratio and miss ratio. 2 1 5 3 4 2 5 1 2 5
  • 10. Q. Suppose there are page requests 2,1,5,3,4,2,5,1,2,5. Assume there are 3 frames in RAM. Show the page replacement by Optimal page replacement algorithm and calculate – number of page hits and page faults, Hit ratio and miss ratio. 2 1 5 3 4 2 5 1 2 5 Page FaultPage Hit 2 2 1 5 2 1 5 2 3 5 4 2 2 4 5 2 4 5 2 1 5 2 1 5 2 1 5 3 is not present. So it will use in far future.4 is not present. So it will use in further future. No. of Page Hit = 4 No. of Page Fault = 6  Hit Ratio = (No. of Page Hit / Total Pages) = 4/10 = 2/5  Miss Ratio = (No. of Page Fault / Total Pages) = 1 – Hit Ratio = 6/10 = 3/5
  • 11. THAT’S ALL FOR THE DAY There is a set of problems from this algorithms are already given. You can download it from the link given below. Link - https://drive.google.com/open?id=10kDzksl- aaPcAESSTB3f30nnxBDhftvL Link is also given in description box. You can mail me the answer sheet on byte2bytelearn@gmail.com
  • 12. HOPE YOU GUYS ENJOY THIS SLIDE. SEE YOU IN THE NEXT VIDEO. STAY HOME, STAY SAFE.