SlideShare a Scribd company logo
Operating System 38
Page Replacement
Prof Neeraj Bhargava
Vaibhav Khanna
Department of Computer Science
School of Engineering and Systems Sciences
Maharshi Dayanand Saraswati University Ajmer
What Happens if There is no Free Frame?
• Used up by process pages
• Also in demand from the kernel, I/O buffers, etc
• How much to allocate to each?
• Page replacement – find some page in memory,
but not really in use, page it out
– Algorithm – terminate? swap out? replace the
page?
– Performance – want an algorithm which will result
in minimum number of page faults
• Same page may be brought into memory several
times
Page Replacement
• Prevent over-allocation of memory by
modifying page-fault service routine
to include page replacement
• Use modify (dirty) bit to reduce
overhead of page transfers – only
modified pages are written to disk
• Page replacement completes
separation between logical memory
and physical memory – large virtual
memory can be provided on a smaller
physical memory
Need For Page Replacement
Basic Page Replacement
1. Find the location of the desired page on disk
2. Find a free frame:
- If there is a free frame, use it
- If there is no free frame, use a page replacement algorithm to
select a victim frame
- Write victim frame to disk if dirty
3. Bring the desired page into the (newly) free frame; update the page
and frame tables
4. Continue the process by restarting the instruction that caused the
trap
Note now potentially 2 page transfers for page fault – increasing EAT
Page Replacement
Page and Frame Replacement Algorithms
• Frame-allocation algorithm determines
– How many frames to give each process
– Which frames to replace
• Page-replacement algorithm
– Want lowest page-fault rate on both first access and re-access
• Evaluate algorithm by running it on a particular string of
memory references (reference string) and computing the
number of page faults on that string
– String is just page numbers, not full addresses
– Repeated access to the same page does not cause a page fault
– Results depend on number of frames available
• In all our examples, the reference string of referenced page
numbers is
7,0,1,2,0,3,0,4,2,3,0,3,0,3,2,1,2,0,1,7,0,1
Graph of Page Faults Versus The Number of Frames
Assignment
1. Explain Page Replacement and its need in
memory management

More Related Content

PPTX
141060753008 3715302
ITM Universe - Vadodara
 
PPT
42 lru optimal
myrajendra
 
PPTX
Page replacement algorithm
Lavina Gehlot
 
PPT
Pagereplacement algorithm(computional concept)
Siddhi Viradiya
 
PPT
Unit 2chapter 2 memory mgmt complete
Kalai Selvi
 
PPTX
Page replacement alg
V.V.Vanniapermal College for Women
 
PPTX
Virtual memory and page replacement algorithm
Muhammad Mansoor Ul Haq
 
PPTX
Page replacement
Davin Abraham
 
141060753008 3715302
ITM Universe - Vadodara
 
42 lru optimal
myrajendra
 
Page replacement algorithm
Lavina Gehlot
 
Pagereplacement algorithm(computional concept)
Siddhi Viradiya
 
Unit 2chapter 2 memory mgmt complete
Kalai Selvi
 
Virtual memory and page replacement algorithm
Muhammad Mansoor Ul Haq
 
Page replacement
Davin Abraham
 

What's hot (16)

PPTX
virtual memory Operating system
Shaheen kousar
 
PPTX
Computer architecture page replacement algorithms
Mazin Alwaaly
 
PPTX
Virtual Memory in Windows
HanzlaRafique
 
PPT
41 page replacement fifo
myrajendra
 
DOCX
Chosse a best algorithm for page replacement to reduce page fault and analysi...
MdAlAmin187
 
PPT
Page replacement
sashi799
 
PDF
Virtual Memory
Mustafa Ugur Oduncu
 
PPTX
Virtual memory ,Allocaton of frame & Trashing
COMSATS Institute of Information Technology
 
PPTX
Page replacement algorithms
sangrampatil81
 
PPTX
Page replacement algorithms
Piyush Rochwani
 
PPTX
Data warehouse 26 exploiting parallel technologies
Vaibhav Khanna
 
PPT
Page Replacement
chandinisanz
 
PPTX
Page Replacement Algorithms
Kashif Dayo
 
PDF
Nano-node: Intelligent Hard Drives in Large Storage Infrastructures
OpenIO Object Storage
 
PPTX
basics of virtual memory
Adarsh Patel
 
virtual memory Operating system
Shaheen kousar
 
Computer architecture page replacement algorithms
Mazin Alwaaly
 
Virtual Memory in Windows
HanzlaRafique
 
41 page replacement fifo
myrajendra
 
Chosse a best algorithm for page replacement to reduce page fault and analysi...
MdAlAmin187
 
Page replacement
sashi799
 
Virtual Memory
Mustafa Ugur Oduncu
 
Virtual memory ,Allocaton of frame & Trashing
COMSATS Institute of Information Technology
 
Page replacement algorithms
sangrampatil81
 
Page replacement algorithms
Piyush Rochwani
 
Data warehouse 26 exploiting parallel technologies
Vaibhav Khanna
 
Page Replacement
chandinisanz
 
Page Replacement Algorithms
Kashif Dayo
 
Nano-node: Intelligent Hard Drives in Large Storage Infrastructures
OpenIO Object Storage
 
basics of virtual memory
Adarsh Patel
 
Ad

Similar to Operating system 38 page replacement (20)

PPTX
Demand paging
Trinity Dwarka
 
PPT
Chapter 9 - Virtual Memory
Wayne Jones Jnr
 
PDF
Virtual Memory.pdf
SujanTimalsina5
 
PPT
OSCh10
Joe Christensen
 
PPT
Ch10 OS
C.U
 
PPTX
operating system virtual memory and logical memory
salihan090918
 
PPTX
Lecture 8- Virtual Memory Final.pptx
Amanuelmergia
 
PPT
Ch09
guest64730d
 
PPTX
Operating system 37 demand paging
Vaibhav Khanna
 
PPT
Virtual memory
Mohammad Sadiq
 
PPT
Mca ii os u-4 memory management
Rai University
 
PDF
Virtual Memory Management Part - II.pdf
Harika Pudugosula
 
PDF
final_unit_6_spos_notes_2023/24 pattern.pdf
silentkillerin2023
 
PDF
Distributed Operating System_3
Dr Sandeep Kumar Poonia
 
PDF
CH09.pdf
ImranKhan880955
 
PPT
Virtual Memory sjkdhikejv vsdkjnksnv vkjhfvk
HKShab
 
PDF
381 ccs chapter7_updated(1)
Rabie Masoud
 
PPTX
Virtual Memory Managementddddddddffffffffffffff.pptx
ananyachouhan70
 
PPTX
operating system notes about virtual memory 4.pptx
panditestmail
 
Demand paging
Trinity Dwarka
 
Chapter 9 - Virtual Memory
Wayne Jones Jnr
 
Virtual Memory.pdf
SujanTimalsina5
 
Ch10 OS
C.U
 
operating system virtual memory and logical memory
salihan090918
 
Lecture 8- Virtual Memory Final.pptx
Amanuelmergia
 
Operating system 37 demand paging
Vaibhav Khanna
 
Virtual memory
Mohammad Sadiq
 
Mca ii os u-4 memory management
Rai University
 
Virtual Memory Management Part - II.pdf
Harika Pudugosula
 
final_unit_6_spos_notes_2023/24 pattern.pdf
silentkillerin2023
 
Distributed Operating System_3
Dr Sandeep Kumar Poonia
 
CH09.pdf
ImranKhan880955
 
Virtual Memory sjkdhikejv vsdkjnksnv vkjhfvk
HKShab
 
381 ccs chapter7_updated(1)
Rabie Masoud
 
Virtual Memory Managementddddddddffffffffffffff.pptx
ananyachouhan70
 
operating system notes about virtual memory 4.pptx
panditestmail
 
Ad

More from Vaibhav Khanna (20)

PPTX
Information and network security 47 authentication applications
Vaibhav Khanna
 
PPTX
Information and network security 46 digital signature algorithm
Vaibhav Khanna
 
PPTX
Information and network security 45 digital signature standard
Vaibhav Khanna
 
PPTX
Information and network security 44 direct digital signatures
Vaibhav Khanna
 
PPTX
Information and network security 43 digital signatures
Vaibhav Khanna
 
PPTX
Information and network security 42 security of message authentication code
Vaibhav Khanna
 
PPTX
Information and network security 41 message authentication code
Vaibhav Khanna
 
PPTX
Information and network security 40 sha3 secure hash algorithm
Vaibhav Khanna
 
PPTX
Information and network security 39 secure hash algorithm
Vaibhav Khanna
 
PPTX
Information and network security 38 birthday attacks and security of hash fun...
Vaibhav Khanna
 
PPTX
Information and network security 37 hash functions and message authentication
Vaibhav Khanna
 
PPTX
Information and network security 35 the chinese remainder theorem
Vaibhav Khanna
 
PPTX
Information and network security 34 primality
Vaibhav Khanna
 
PPTX
Information and network security 33 rsa algorithm
Vaibhav Khanna
 
PPTX
Information and network security 32 principles of public key cryptosystems
Vaibhav Khanna
 
PPTX
Information and network security 31 public key cryptography
Vaibhav Khanna
 
PPTX
Information and network security 30 random numbers
Vaibhav Khanna
 
PPTX
Information and network security 29 international data encryption algorithm
Vaibhav Khanna
 
PPTX
Information and network security 28 blowfish
Vaibhav Khanna
 
PPTX
Information and network security 27 triple des
Vaibhav Khanna
 
Information and network security 47 authentication applications
Vaibhav Khanna
 
Information and network security 46 digital signature algorithm
Vaibhav Khanna
 
Information and network security 45 digital signature standard
Vaibhav Khanna
 
Information and network security 44 direct digital signatures
Vaibhav Khanna
 
Information and network security 43 digital signatures
Vaibhav Khanna
 
Information and network security 42 security of message authentication code
Vaibhav Khanna
 
Information and network security 41 message authentication code
Vaibhav Khanna
 
Information and network security 40 sha3 secure hash algorithm
Vaibhav Khanna
 
Information and network security 39 secure hash algorithm
Vaibhav Khanna
 
Information and network security 38 birthday attacks and security of hash fun...
Vaibhav Khanna
 
Information and network security 37 hash functions and message authentication
Vaibhav Khanna
 
Information and network security 35 the chinese remainder theorem
Vaibhav Khanna
 
Information and network security 34 primality
Vaibhav Khanna
 
Information and network security 33 rsa algorithm
Vaibhav Khanna
 
Information and network security 32 principles of public key cryptosystems
Vaibhav Khanna
 
Information and network security 31 public key cryptography
Vaibhav Khanna
 
Information and network security 30 random numbers
Vaibhav Khanna
 
Information and network security 29 international data encryption algorithm
Vaibhav Khanna
 
Information and network security 28 blowfish
Vaibhav Khanna
 
Information and network security 27 triple des
Vaibhav Khanna
 

Recently uploaded (20)

PDF
Enhancing Healthcare RPM Platforms with Contextual AI Integration
Cadabra Studio
 
PDF
What to consider before purchasing Microsoft 365 Business Premium_PDF.pdf
Q-Advise
 
PDF
Balancing Resource Capacity and Workloads with OnePlan – Avoid Overloading Te...
OnePlan Solutions
 
PPTX
classification of computer and basic part of digital computer
ravisinghrajpurohit3
 
PDF
vAdobe Premiere Pro 2025 (v25.2.3.004) Crack Pre-Activated Latest
imang66g
 
PPT
Activate_Methodology_Summary presentatio
annapureddyn
 
PPTX
Contractor Management Platform and Software Solution for Compliance
SHEQ Network Limited
 
PPTX
Web Testing.pptx528278vshbuqffqhhqiwnwuq
studylike474
 
PDF
Generating Union types w/ Static Analysis
K. Matthew Dupree
 
PDF
MiniTool Power Data Recovery Crack New Pre Activated Version Latest 2025
imang66g
 
PDF
Exploring AI Agents in Process Industries
amoreira6
 
PDF
Applitools Platform Pulse: What's New and What's Coming - July 2025
Applitools
 
PPTX
Role Of Python In Programing Language.pptx
jaykoshti048
 
PDF
49784907924775488180_LRN2959_Data_Pump_23ai.pdf
Abilash868456
 
PPTX
Can You Build Dashboards Using Open Source Visualization Tool.pptx
Varsha Nayak
 
PPTX
Explanation about Structures in C language.pptx
Veeral Rathod
 
PPTX
Presentation about Database and Database Administrator
abhishekchauhan86963
 
PDF
On Software Engineers' Productivity - Beyond Misleading Metrics
Romén Rodríguez-Gil
 
PDF
Teaching Reproducibility and Embracing Variability: From Floating-Point Exper...
University of Rennes, INSA Rennes, Inria/IRISA, CNRS
 
PPTX
Odoo Integration Services by Candidroot Solutions
CandidRoot Solutions Private Limited
 
Enhancing Healthcare RPM Platforms with Contextual AI Integration
Cadabra Studio
 
What to consider before purchasing Microsoft 365 Business Premium_PDF.pdf
Q-Advise
 
Balancing Resource Capacity and Workloads with OnePlan – Avoid Overloading Te...
OnePlan Solutions
 
classification of computer and basic part of digital computer
ravisinghrajpurohit3
 
vAdobe Premiere Pro 2025 (v25.2.3.004) Crack Pre-Activated Latest
imang66g
 
Activate_Methodology_Summary presentatio
annapureddyn
 
Contractor Management Platform and Software Solution for Compliance
SHEQ Network Limited
 
Web Testing.pptx528278vshbuqffqhhqiwnwuq
studylike474
 
Generating Union types w/ Static Analysis
K. Matthew Dupree
 
MiniTool Power Data Recovery Crack New Pre Activated Version Latest 2025
imang66g
 
Exploring AI Agents in Process Industries
amoreira6
 
Applitools Platform Pulse: What's New and What's Coming - July 2025
Applitools
 
Role Of Python In Programing Language.pptx
jaykoshti048
 
49784907924775488180_LRN2959_Data_Pump_23ai.pdf
Abilash868456
 
Can You Build Dashboards Using Open Source Visualization Tool.pptx
Varsha Nayak
 
Explanation about Structures in C language.pptx
Veeral Rathod
 
Presentation about Database and Database Administrator
abhishekchauhan86963
 
On Software Engineers' Productivity - Beyond Misleading Metrics
Romén Rodríguez-Gil
 
Teaching Reproducibility and Embracing Variability: From Floating-Point Exper...
University of Rennes, INSA Rennes, Inria/IRISA, CNRS
 
Odoo Integration Services by Candidroot Solutions
CandidRoot Solutions Private Limited
 

Operating system 38 page replacement

  • 1. Operating System 38 Page Replacement Prof Neeraj Bhargava Vaibhav Khanna Department of Computer Science School of Engineering and Systems Sciences Maharshi Dayanand Saraswati University Ajmer
  • 2. What Happens if There is no Free Frame? • Used up by process pages • Also in demand from the kernel, I/O buffers, etc • How much to allocate to each? • Page replacement – find some page in memory, but not really in use, page it out – Algorithm – terminate? swap out? replace the page? – Performance – want an algorithm which will result in minimum number of page faults • Same page may be brought into memory several times
  • 3. Page Replacement • Prevent over-allocation of memory by modifying page-fault service routine to include page replacement • Use modify (dirty) bit to reduce overhead of page transfers – only modified pages are written to disk • Page replacement completes separation between logical memory and physical memory – large virtual memory can be provided on a smaller physical memory
  • 4. Need For Page Replacement
  • 5. Basic Page Replacement 1. Find the location of the desired page on disk 2. Find a free frame: - If there is a free frame, use it - If there is no free frame, use a page replacement algorithm to select a victim frame - Write victim frame to disk if dirty 3. Bring the desired page into the (newly) free frame; update the page and frame tables 4. Continue the process by restarting the instruction that caused the trap Note now potentially 2 page transfers for page fault – increasing EAT
  • 7. Page and Frame Replacement Algorithms • Frame-allocation algorithm determines – How many frames to give each process – Which frames to replace • Page-replacement algorithm – Want lowest page-fault rate on both first access and re-access • Evaluate algorithm by running it on a particular string of memory references (reference string) and computing the number of page faults on that string – String is just page numbers, not full addresses – Repeated access to the same page does not cause a page fault – Results depend on number of frames available • In all our examples, the reference string of referenced page numbers is 7,0,1,2,0,3,0,4,2,3,0,3,0,3,2,1,2,0,1,7,0,1
  • 8. Graph of Page Faults Versus The Number of Frames
  • 9. Assignment 1. Explain Page Replacement and its need in memory management