SlideShare a Scribd company logo
1 of 11
Page Replacement Algorithms
By,
Nikhil Katte
NKOCET, Solapur
02-04-2020
Points to be covered
 Page Fault
 Optimal Page Replacement Algorithm
 First In First Out (FIFO) Algorithm
 Least Recently Used Algorithm
02-04-2020
PAGE FAULT
 A page fault happens when a running program accesses a memory
page that is mapped into the virtual address space, but not loaded in
physical memory.
 Since actual physical memory is much smaller than virtual memory,
page faults happen.
02-04-2020
Contd.
 In case of page fault, Operating System might have to replace one of
the existing pages with newly needed page.
 Different page replacement algorithms suggest different ways to
decide which page to replace. The target for all algorithms is to reduce
number of page faults.
02-04-2020
OPTIMAL PAGE REPLACEMENT ALGORITHM
 In this algorithm, pages are replaced which would not be used for the
longest duration of time in the future.
 It is also known as Belady’s optimal page replacement policy.
 Despite this limitation, algorithms exist that can offer near-optimal
performance — the operating system keeps track of all pages
referenced by the program.
02-04-2020
Contd.
 Hence Operating System uses those data to decide which pages to
swap in and out on subsequent runs.
 Optimal Page Replacement is difficult to implement, because it is
depend on future pages.
 As it is difficult to implement, but it will gives the Best Best result.
 Let’s see the Example,
02-04-2020
FIRST IN FIRST OUT(FIFO)
 This is the simplest page replacement algorithm.
 In this algorithm, operating system keeps track of all pages in the
memory in a queue, oldest page is in the front of the queue.
 When a page needs to be replaced page in the front of the queue is
selected for removal.
02-04-2020
Contd.
 For example-1, consider page reference string 1, 3, 0, 3, 5, 6 and 3
page slots.
 Initially all slots are empty, so when 1, 3, 0 came they are allocated to
the empty slots —> 3 Page Faults.
when 3 comes, it is already in memory so —> 0 Page Faults.
Then 5 comes, it is not available in memory so it replaces the oldest
page slot i.e. 1. —>1 Page Fault.
Finally 6 comes, it is also not available in memory so it replaces the
oldest page slot i.e. 3 —>1 Page Fault.
 Let’s see the another example,
02-04-2020
LEAST RECENTLY USED(LRU)
 Here Recent word is connected to the TIME.
 Least word is connected to the FREQUENCY.
 LRU algorithm works on the concept that the pages that are heavily
used in previous instructions are likely to be used heavily in next
instructions.
02-04-2020
Contd.
 The page that are used very less are likely to be used less in future.
 Whenever a page fault occurs, the page that is least recently used is
removed from the memory frames.
 Page fault occurs when a referenced page in not found in the memory
frames.
 Let’s see the Example,
02-04-2020
THANK YOU…!
02-04-2020

More Related Content

Similar to Page replacement algorithm

Adobe Scan 06-Jan-2023.pdf demand paging document
Adobe Scan 06-Jan-2023.pdf demand paging documentAdobe Scan 06-Jan-2023.pdf demand paging document
Adobe Scan 06-Jan-2023.pdf demand paging document
AllyKhan2
 

Similar to Page replacement algorithm (20)

Virtual memory management in Operating System
Virtual memory management in Operating SystemVirtual memory management in Operating System
Virtual memory management in Operating System
 
Page replacement
Page replacementPage replacement
Page replacement
 
STORAGE MANAGEMENT AND PAGING ALGORITHMS.pptx
STORAGE MANAGEMENT AND PAGING ALGORITHMS.pptxSTORAGE MANAGEMENT AND PAGING ALGORITHMS.pptx
STORAGE MANAGEMENT AND PAGING ALGORITHMS.pptx
 
Chapter 9 - Virtual Memory
Chapter 9 - Virtual MemoryChapter 9 - Virtual Memory
Chapter 9 - Virtual Memory
 
Operating System
Operating SystemOperating System
Operating System
 
virtual memory Operating system
virtual memory Operating system virtual memory Operating system
virtual memory Operating system
 
LRU_Replacement-Policy.pdf
LRU_Replacement-Policy.pdfLRU_Replacement-Policy.pdf
LRU_Replacement-Policy.pdf
 
Virtual Memory in Operating System
Virtual Memory in Operating SystemVirtual Memory in Operating System
Virtual Memory in Operating System
 
Adobe Scan 06-Jan-2023.pdf demand paging document
Adobe Scan 06-Jan-2023.pdf demand paging documentAdobe Scan 06-Jan-2023.pdf demand paging document
Adobe Scan 06-Jan-2023.pdf demand paging document
 
VM Page Replacement
VM Page ReplacementVM Page Replacement
VM Page Replacement
 
Virtual memory
Virtual memoryVirtual memory
Virtual memory
 
Mem mgt
Mem mgtMem mgt
Mem mgt
 
An input enhancement technique to maximize the performance of page replacemen...
An input enhancement technique to maximize the performance of page replacemen...An input enhancement technique to maximize the performance of page replacemen...
An input enhancement technique to maximize the performance of page replacemen...
 
CSI-503 - 9. Virtual Memory
CSI-503 - 9. Virtual MemoryCSI-503 - 9. Virtual Memory
CSI-503 - 9. Virtual Memory
 
Unit 2chapter 2 memory mgmt complete
Unit 2chapter 2  memory mgmt completeUnit 2chapter 2  memory mgmt complete
Unit 2chapter 2 memory mgmt complete
 
Ie3313971401
Ie3313971401Ie3313971401
Ie3313971401
 
Ie3313971401
Ie3313971401Ie3313971401
Ie3313971401
 
Virtual memory This is the operating system ppt.ppt
Virtual memory This is the operating system ppt.pptVirtual memory This is the operating system ppt.ppt
Virtual memory This is the operating system ppt.ppt
 
4.-CSE-3201_OL1_Paging.pdf
4.-CSE-3201_OL1_Paging.pdf4.-CSE-3201_OL1_Paging.pdf
4.-CSE-3201_OL1_Paging.pdf
 
A kind of Algorithm that Extend MLC SSD Life Expectancy by 3 Folds
A kind of Algorithm that Extend MLC SSD Life Expectancy by 3 FoldsA kind of Algorithm that Extend MLC SSD Life Expectancy by 3 Folds
A kind of Algorithm that Extend MLC SSD Life Expectancy by 3 Folds
 

Recently uploaded

Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
dharasingh5698
 
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
amitlee9823
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Christo Ananth
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
dollysharma2066
 

Recently uploaded (20)

Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
 
Call for Papers - International Journal of Intelligent Systems and Applicatio...
Call for Papers - International Journal of Intelligent Systems and Applicatio...Call for Papers - International Journal of Intelligent Systems and Applicatio...
Call for Papers - International Journal of Intelligent Systems and Applicatio...
 
chapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringchapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineering
 
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdf
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torque
 
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
 
Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
 
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank  Design by Working Stress - IS Method.pdfIntze Overhead Water Tank  Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
 
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 

Page replacement algorithm

  • 1. Page Replacement Algorithms By, Nikhil Katte NKOCET, Solapur 02-04-2020
  • 2. Points to be covered  Page Fault  Optimal Page Replacement Algorithm  First In First Out (FIFO) Algorithm  Least Recently Used Algorithm 02-04-2020
  • 3. PAGE FAULT  A page fault happens when a running program accesses a memory page that is mapped into the virtual address space, but not loaded in physical memory.  Since actual physical memory is much smaller than virtual memory, page faults happen. 02-04-2020
  • 4. Contd.  In case of page fault, Operating System might have to replace one of the existing pages with newly needed page.  Different page replacement algorithms suggest different ways to decide which page to replace. The target for all algorithms is to reduce number of page faults. 02-04-2020
  • 5. OPTIMAL PAGE REPLACEMENT ALGORITHM  In this algorithm, pages are replaced which would not be used for the longest duration of time in the future.  It is also known as Belady’s optimal page replacement policy.  Despite this limitation, algorithms exist that can offer near-optimal performance — the operating system keeps track of all pages referenced by the program. 02-04-2020
  • 6. Contd.  Hence Operating System uses those data to decide which pages to swap in and out on subsequent runs.  Optimal Page Replacement is difficult to implement, because it is depend on future pages.  As it is difficult to implement, but it will gives the Best Best result.  Let’s see the Example, 02-04-2020
  • 7. FIRST IN FIRST OUT(FIFO)  This is the simplest page replacement algorithm.  In this algorithm, operating system keeps track of all pages in the memory in a queue, oldest page is in the front of the queue.  When a page needs to be replaced page in the front of the queue is selected for removal. 02-04-2020
  • 8. Contd.  For example-1, consider page reference string 1, 3, 0, 3, 5, 6 and 3 page slots.  Initially all slots are empty, so when 1, 3, 0 came they are allocated to the empty slots —> 3 Page Faults. when 3 comes, it is already in memory so —> 0 Page Faults. Then 5 comes, it is not available in memory so it replaces the oldest page slot i.e. 1. —>1 Page Fault. Finally 6 comes, it is also not available in memory so it replaces the oldest page slot i.e. 3 —>1 Page Fault.  Let’s see the another example, 02-04-2020
  • 9. LEAST RECENTLY USED(LRU)  Here Recent word is connected to the TIME.  Least word is connected to the FREQUENCY.  LRU algorithm works on the concept that the pages that are heavily used in previous instructions are likely to be used heavily in next instructions. 02-04-2020
  • 10. Contd.  The page that are used very less are likely to be used less in future.  Whenever a page fault occurs, the page that is least recently used is removed from the memory frames.  Page fault occurs when a referenced page in not found in the memory frames.  Let’s see the Example, 02-04-2020