SlideShare a Scribd company logo
Pagereplacement algorithm(computional concept)
Overview
1. Why we need page replacement?
2. Basic page replacement technique.
3. Different type of page replacement algorithm and
their examples.
Why????
Limited physical memory --> limited number of
frame --> limited number of frame allocated to a
process.
Basic Page Replacement
1. Find the location of the desired page on the
disk.
2. Find a free frame
 If there is a free frame use it.
 No free frame – use page replacement algorithm to
select a victim frame.
 Write the victim frame to disk, change the frame and
page tables accordingly.
Basic Page Replacement (Contd)
3. Read the desired page into the newly freed frame,
change the page and frame tables.
4. Restart the user process.
Page Replacement
Victim
Swap desire
page in
Reset page
table for new
page
Change to
invaid
Page table
Frame
Valid
invalid bit
2
4
3
0
F
I
V
Swap out
victim page
1
Physical memory
Overhead
If no free frames - 2 page transfers.
Solution : Modify bit or Dirty bit.
Replacement Policy
Which page to be replaced?
Page removed should be the page least likely to be
referenced in the near future.
Most policies predict the future behavior on the basis
of past behavior.
Page faults versus number of frames
Number of frames
Number of page
faults
Replacement Algorithm
1. FIFO page replacement
2. Optimal page replacement
3. LRU page replacement
FIFO Page Replacement
Easy to understand and program.
Performance is not always good.
Belady’s Anomaly
Drawbacks - FIFO
A page which is being accessed quite often may also
get replaced because it arrived earlier than those
present
Ignores locality of reference. A page which was
referenced last may also get replaced, although there
is high probability that the same page may be needed
again.
FIFO – An Example
7 0 1 2 0 3 0 4 2 3 0 3 2 1 2 0 1 7 0 1
7
0
7 7
0
1
2
0
1
2
3
1
2
3
0
4
3
0
4
2
0
4
2
3
0
2
3
0
1
3
0
1
2
7
1
2
7
0
2
7
0
1
Optimal Page Replacement
Lowest page fault rate of all algorithms
Free from Belady’s anomaly
Optimal Page Replacement (contd)
“Replace the page that will not be used for the longest
period of time.”
Requires future knowledge of the reference string.
Used for comparison studies.
OPR – An Example
7 0 1 2 0 3 0 4 2 3 0 3 2 1 2 0 1 7 0 1
7
0
7 7
0
1
2
0
1
2
0
3
2
4
3
2
0
3
7
0
1
2
0
1
LRU Page Replacement
Free from Belady’s Anomaly.
Problem: How to order the frame defined by the time
of last use.
Solution:
 Counters
 Queue
LRU – An Example
7 0 1 2 0 3 0 4 2 3 0 3 2 1 2 0 1 7 0 1
7
0
7 7
0
1
2
0
1
2
0
3
4
3
4
2
3
2
0
3
7
0
1
0
4
2
0
2
3
1
2
0
1
Ans: C
1. Dirty bit is used to show the
a. page with corrupted data
b. the wrong page in the memory
c. page that is modified after being loaded
into cache memory
d. page that is less frequently accessed.
Ans: C
2. What replacement policy is used by Windows NT
a. LRU
b. NFU
c. FIFO
d. Clock Replacement
e. None of the above
Reference String
4. The string of memory references is called
___________.
Belady’s Anomaly
5. FIFO page replacement suffers from
________________anomaly.
Page fault increases with increase in number of
frames.
6. What is Belady’s anomaly??
TRUE
7. Optimal Page Replacement algorithm has the
lowest page fault rate.
TRUE/FALSE

More Related Content

PPTX
PPTX
Page replacement algorithm
PPTX
Virtual memory and page replacement algorithm
PPTX
141060753008 3715302
PPTX
FIFO, LRU, OPTIMAL Page Replacement Algorithm
PPTX
Computer architecture page replacement algorithms
PPT
Page Replacement
PPT
Page replacement
Page replacement algorithm
Virtual memory and page replacement algorithm
141060753008 3715302
FIFO, LRU, OPTIMAL Page Replacement Algorithm
Computer architecture page replacement algorithms
Page Replacement
Page replacement

What's hot (20)

PPTX
Page replacement
PPTX
Page replacement algorithms
PPT
42 lru optimal
PPTX
Page Replacement Algorithms
PPTX
Page replacement algorithms
PPTX
Virtual memory ,Allocaton of frame & Trashing
PPT
Virtual memory
PPTX
Virtual Memory Management
PPT
Virtual memory
PPTX
Allocation of Frames & Thrashing
PPTX
Operating system 38 page replacement
PPT
Chapter 9 - Virtual Memory
PPTX
basics of virtual memory
PPTX
Virtual Memory in Windows
PPT
Virtual memory - Demand Paging
PPT
Translation Lookaside Buffer & Inverted Page Table
PPT
Virtual memory
TXT
No sql
PPTX
Virtual Memory
PPTX
virtual memory Operating system
Page replacement
Page replacement algorithms
42 lru optimal
Page Replacement Algorithms
Page replacement algorithms
Virtual memory ,Allocaton of frame & Trashing
Virtual memory
Virtual Memory Management
Virtual memory
Allocation of Frames & Thrashing
Operating system 38 page replacement
Chapter 9 - Virtual Memory
basics of virtual memory
Virtual Memory in Windows
Virtual memory - Demand Paging
Translation Lookaside Buffer & Inverted Page Table
Virtual memory
No sql
Virtual Memory
virtual memory Operating system
Ad

Similar to Pagereplacement algorithm(computional concept) (20)

PPTX
page replacement.pptx
PPT
9415070 deepak kumar raja kumar hgdxgfgcg
PDF
Pge Replacement Algorithm.pdf
PPTX
Page replacement algorithm
PPTX
operating system notes about virtual memory 4.pptx
PPTX
3_page_replacement_algorithms computer system and architecture
PPTX
Page replacement_Architecture ppt (213015018+213015017).pptx
PPT
Replacement.ppt operating system in BCA cu
PPT
Explain about replacement algorithms from these slides
PPTX
Virtual memory management in Operating System
PPT
Operating System
DOCX
Chosse a best algorithm for page replacement to reduce page fault and analysi...
PDF
final_unit_6_spos_notes_2023/24 pattern.pdf
PPTX
Demand paging
PPTX
Virtual Memory in Operating System
PPTX
Operating system 40 lru algorithm
PDF
Virtual Memory Management Part - II.pdf
PPT
VM Page Replacement
PPT
41 page replacement fifo
page replacement.pptx
9415070 deepak kumar raja kumar hgdxgfgcg
Pge Replacement Algorithm.pdf
Page replacement algorithm
operating system notes about virtual memory 4.pptx
3_page_replacement_algorithms computer system and architecture
Page replacement_Architecture ppt (213015018+213015017).pptx
Replacement.ppt operating system in BCA cu
Explain about replacement algorithms from these slides
Virtual memory management in Operating System
Operating System
Chosse a best algorithm for page replacement to reduce page fault and analysi...
final_unit_6_spos_notes_2023/24 pattern.pdf
Demand paging
Virtual Memory in Operating System
Operating system 40 lru algorithm
Virtual Memory Management Part - II.pdf
VM Page Replacement
41 page replacement fifo
Ad

More from Siddhi Viradiya (7)

PPTX
network convergence problem and solutions
PPTX
bus and memory tranfer (computer organaization)
PPT
chapter 1 intoduction to operating system
PPT
functional dependencies with example
PPTX
non linear data structure -introduction of tree
PPTX
AEM Fourier series
PPT
global warming ch-07
network convergence problem and solutions
bus and memory tranfer (computer organaization)
chapter 1 intoduction to operating system
functional dependencies with example
non linear data structure -introduction of tree
AEM Fourier series
global warming ch-07

Recently uploaded (20)

PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
PDF
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
PPTX
additive manufacturing of ss316l using mig welding
PPTX
Sustainable Sites - Green Building Construction
PPTX
UNIT 4 Total Quality Management .pptx
PDF
R24 SURVEYING LAB MANUAL for civil enggi
PDF
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
PPTX
CYBER-CRIMES AND SECURITY A guide to understanding
PPTX
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
PDF
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
PDF
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
PDF
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
PPTX
OOP with Java - Java Introduction (Basics)
PPTX
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
PPT
Mechanical Engineering MATERIALS Selection
PPTX
Internet of Things (IOT) - A guide to understanding
PDF
composite construction of structures.pdf
PPTX
Current and future trends in Computer Vision.pptx
PDF
Model Code of Practice - Construction Work - 21102022 .pdf
PDF
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
additive manufacturing of ss316l using mig welding
Sustainable Sites - Green Building Construction
UNIT 4 Total Quality Management .pptx
R24 SURVEYING LAB MANUAL for civil enggi
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
CYBER-CRIMES AND SECURITY A guide to understanding
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
OOP with Java - Java Introduction (Basics)
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
Mechanical Engineering MATERIALS Selection
Internet of Things (IOT) - A guide to understanding
composite construction of structures.pdf
Current and future trends in Computer Vision.pptx
Model Code of Practice - Construction Work - 21102022 .pdf
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf

Pagereplacement algorithm(computional concept)

  • 2. Overview 1. Why we need page replacement? 2. Basic page replacement technique. 3. Different type of page replacement algorithm and their examples.
  • 3. Why???? Limited physical memory --> limited number of frame --> limited number of frame allocated to a process.
  • 4. Basic Page Replacement 1. Find the location of the desired page on the disk. 2. Find a free frame  If there is a free frame use it.  No free frame – use page replacement algorithm to select a victim frame.  Write the victim frame to disk, change the frame and page tables accordingly.
  • 5. Basic Page Replacement (Contd) 3. Read the desired page into the newly freed frame, change the page and frame tables. 4. Restart the user process.
  • 6. Page Replacement Victim Swap desire page in Reset page table for new page Change to invaid Page table Frame Valid invalid bit 2 4 3 0 F I V Swap out victim page 1 Physical memory
  • 7. Overhead If no free frames - 2 page transfers. Solution : Modify bit or Dirty bit.
  • 8. Replacement Policy Which page to be replaced? Page removed should be the page least likely to be referenced in the near future. Most policies predict the future behavior on the basis of past behavior.
  • 9. Page faults versus number of frames Number of frames Number of page faults
  • 10. Replacement Algorithm 1. FIFO page replacement 2. Optimal page replacement 3. LRU page replacement
  • 11. FIFO Page Replacement Easy to understand and program. Performance is not always good. Belady’s Anomaly
  • 12. Drawbacks - FIFO A page which is being accessed quite often may also get replaced because it arrived earlier than those present Ignores locality of reference. A page which was referenced last may also get replaced, although there is high probability that the same page may be needed again.
  • 13. FIFO – An Example 7 0 1 2 0 3 0 4 2 3 0 3 2 1 2 0 1 7 0 1 7 0 7 7 0 1 2 0 1 2 3 1 2 3 0 4 3 0 4 2 0 4 2 3 0 2 3 0 1 3 0 1 2 7 1 2 7 0 2 7 0 1
  • 14. Optimal Page Replacement Lowest page fault rate of all algorithms Free from Belady’s anomaly
  • 15. Optimal Page Replacement (contd) “Replace the page that will not be used for the longest period of time.” Requires future knowledge of the reference string. Used for comparison studies.
  • 16. OPR – An Example 7 0 1 2 0 3 0 4 2 3 0 3 2 1 2 0 1 7 0 1 7 0 7 7 0 1 2 0 1 2 0 3 2 4 3 2 0 3 7 0 1 2 0 1
  • 17. LRU Page Replacement Free from Belady’s Anomaly. Problem: How to order the frame defined by the time of last use. Solution:  Counters  Queue
  • 18. LRU – An Example 7 0 1 2 0 3 0 4 2 3 0 3 2 1 2 0 1 7 0 1 7 0 7 7 0 1 2 0 1 2 0 3 4 3 4 2 3 2 0 3 7 0 1 0 4 2 0 2 3 1 2 0 1
  • 19. Ans: C 1. Dirty bit is used to show the a. page with corrupted data b. the wrong page in the memory c. page that is modified after being loaded into cache memory d. page that is less frequently accessed.
  • 20. Ans: C 2. What replacement policy is used by Windows NT a. LRU b. NFU c. FIFO d. Clock Replacement e. None of the above
  • 21. Reference String 4. The string of memory references is called ___________.
  • 22. Belady’s Anomaly 5. FIFO page replacement suffers from ________________anomaly.
  • 23. Page fault increases with increase in number of frames. 6. What is Belady’s anomaly??
  • 24. TRUE 7. Optimal Page Replacement algorithm has the lowest page fault rate. TRUE/FALSE