SlideShare a Scribd company logo
Demand Paging
Demand Paging
 Could bring entire process into memory at load time
 Or bring a page into memory only when it is needed
 Less I/O needed, no unnecessary I/O
 Less memory needed
 Faster response
 More users
 Similar to paging system with swapping (diagram on
right)
 Page is needed  reference to it
 invalid reference  abort
 not-in-memory  bring to memory
 Lazy swapper – never swaps a page into memory
unless page will be needed
 Swapper that deals with pages is a pager
Basic Concepts
 With swapping, pager guesses which pages will be used before swapping out again
 Instead, pager brings in only those pages into memory
 How to determine that set of pages?
 Need new MMU functionality to implement demand paging
 If pages needed are already memory resident
 No difference from non demand-paging
 If page needed and not memory resident
 Need to detect and load the page into memory from storage
 Without changing program behavior
 Without programmer needing to change code
Valid-Invalid Bit
 With each page table entry a valid–invalid bit is associated
(v  in-memory – memory resident, i  not-in-memory)
 Initially valid–invalid bit is set to i on all entries
 Example of a page table snapshot:
 During MMU address translation, if valid–invalid bit in page table entry is i  page fault
Page Table When Some Pages Are Not in Main Memory
Page Fault
 If there is a reference to a page, first reference to that page will trap to operating system:
page fault
1. Operating system looks at another table to decide:
 Invalid reference  abort
 Just not in memory
2. Find free frame
3. Swap page into frame via scheduled disk operation
4. Reset tables to indicate page now in memory
Set validation bit = v
5. Restart the instruction that caused the page fault
Page Fault

More Related Content

Similar to Demand Paging.pptx

Chapter 9 - Virtual Memory
Chapter 9 - Virtual MemoryChapter 9 - Virtual Memory
Chapter 9 - Virtual Memory
Wayne Jones Jnr
 
Virtual memory
Virtual memoryVirtual memory
Virtual memory
lodhran-hayat
 
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
ry54321288
 
Unit 2chapter 2 memory mgmt complete
Unit 2chapter 2  memory mgmt completeUnit 2chapter 2  memory mgmt complete
Unit 2chapter 2 memory mgmt complete
Kalai Selvi
 
Page replacement algorithms
Page replacement algorithmsPage replacement algorithms
Page replacement algorithms
sangrampatil81
 
Ch10 OS
Ch10 OSCh10 OS
Ch10 OSC.U
 
Demand paging
Demand pagingDemand paging
Demand paging
Trinity Dwarka
 
Sucet os module_4_notes
Sucet os module_4_notesSucet os module_4_notes
Sucet os module_4_notes
SRINIVASUNIVERSITYEN
 
Virtual memory management in Operating System
Virtual memory management in Operating SystemVirtual memory management in Operating System
Virtual memory management in Operating System
Rashmi Bhat
 
Computer architecture virtual memory
Computer architecture virtual memoryComputer architecture virtual memory
Computer architecture virtual memory
Mazin Alwaaly
 
virtual memory Operating system
virtual memory Operating system virtual memory Operating system
virtual memory Operating system
Shaheen kousar
 
Virtual Memory.pdf
Virtual Memory.pdfVirtual Memory.pdf
Virtual Memory.pdf
SujanTimalsina5
 
CSI-503 - 9. Virtual Memory
CSI-503 - 9. Virtual MemoryCSI-503 - 9. Virtual Memory
CSI-503 - 9. Virtual Memory
ghayour abbas
 
virtual memory
virtual memoryvirtual memory
virtual memory
sangrampatil81
 
Operating system 38 page replacement
Operating system 38 page replacementOperating system 38 page replacement
Operating system 38 page replacement
Vaibhav Khanna
 

Similar to Demand Paging.pptx (20)

Chapter 9 - Virtual Memory
Chapter 9 - Virtual MemoryChapter 9 - Virtual Memory
Chapter 9 - Virtual Memory
 
Virtual memory
Virtual memoryVirtual memory
Virtual memory
 
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
 
Unit 2chapter 2 memory mgmt complete
Unit 2chapter 2  memory mgmt completeUnit 2chapter 2  memory mgmt complete
Unit 2chapter 2 memory mgmt complete
 
Page replacement algorithms
Page replacement algorithmsPage replacement algorithms
Page replacement algorithms
 
OS_Ch10
OS_Ch10OS_Ch10
OS_Ch10
 
Ch10 OS
Ch10 OSCh10 OS
Ch10 OS
 
OSCh10
OSCh10OSCh10
OSCh10
 
Demand paging
Demand pagingDemand paging
Demand paging
 
Ch09
Ch09Ch09
Ch09
 
Sucet os module_4_notes
Sucet os module_4_notesSucet os module_4_notes
Sucet os module_4_notes
 
Virtual memory management in Operating System
Virtual memory management in Operating SystemVirtual memory management in Operating System
Virtual memory management in Operating System
 
Computer architecture virtual memory
Computer architecture virtual memoryComputer architecture virtual memory
Computer architecture virtual memory
 
virtual memory Operating system
virtual memory Operating system virtual memory Operating system
virtual memory Operating system
 
Virtual memory
Virtual memoryVirtual memory
Virtual memory
 
Virtual Memory.pdf
Virtual Memory.pdfVirtual Memory.pdf
Virtual Memory.pdf
 
CSI-503 - 9. Virtual Memory
CSI-503 - 9. Virtual MemoryCSI-503 - 9. Virtual Memory
CSI-503 - 9. Virtual Memory
 
virtual memory
virtual memoryvirtual memory
virtual memory
 
Virtual memory
Virtual memory Virtual memory
Virtual memory
 
Operating system 38 page replacement
Operating system 38 page replacementOperating system 38 page replacement
Operating system 38 page replacement
 

More from BharathiLakshmiAAssi

VB.net&OOP.pptx
VB.net&OOP.pptxVB.net&OOP.pptx
VB.net&OOP.pptx
BharathiLakshmiAAssi
 
VB.netIDE.pptx
VB.netIDE.pptxVB.netIDE.pptx
VB.netIDE.pptx
BharathiLakshmiAAssi
 
VB.Net-Introduction.ppt
VB.Net-Introduction.pptVB.Net-Introduction.ppt
VB.Net-Introduction.ppt
BharathiLakshmiAAssi
 
File Allocation Methods.ppt
File Allocation Methods.pptFile Allocation Methods.ppt
File Allocation Methods.ppt
BharathiLakshmiAAssi
 
Virtual Memory.pptx
Virtual Memory.pptxVirtual Memory.pptx
Virtual Memory.pptx
BharathiLakshmiAAssi
 
Knowing about Computer SS.pptx
Knowing about Computer SS.pptxKnowing about Computer SS.pptx
Knowing about Computer SS.pptx
BharathiLakshmiAAssi
 
Parallel Computing--Webminar.ppsx
Parallel Computing--Webminar.ppsxParallel Computing--Webminar.ppsx
Parallel Computing--Webminar.ppsx
BharathiLakshmiAAssi
 
MAPEM.ppsx
MAPEM.ppsxMAPEM.ppsx
Iterative Algorithms.ppsx
Iterative Algorithms.ppsxIterative Algorithms.ppsx
Iterative Algorithms.ppsx
BharathiLakshmiAAssi
 
Intensity Transformation.ppsx
Intensity Transformation.ppsxIntensity Transformation.ppsx
Intensity Transformation.ppsx
BharathiLakshmiAAssi
 
MAtrix Multiplication Parallel.ppsx
MAtrix Multiplication Parallel.ppsxMAtrix Multiplication Parallel.ppsx
MAtrix Multiplication Parallel.ppsx
BharathiLakshmiAAssi
 
Web Designing.ppsx
Web Designing.ppsxWeb Designing.ppsx
Web Designing.ppsx
BharathiLakshmiAAssi
 
Graphics Designing-Intro.ppsx
Graphics Designing-Intro.ppsxGraphics Designing-Intro.ppsx
Graphics Designing-Intro.ppsx
BharathiLakshmiAAssi
 
Intensity Transformation & Spatial Filtering.ppsx
Intensity Transformation & Spatial Filtering.ppsxIntensity Transformation & Spatial Filtering.ppsx
Intensity Transformation & Spatial Filtering.ppsx
BharathiLakshmiAAssi
 
DIP Slide Share.ppsx
DIP Slide Share.ppsxDIP Slide Share.ppsx
DIP Slide Share.ppsx
BharathiLakshmiAAssi
 
Class Timetable.ppsx
Class Timetable.ppsxClass Timetable.ppsx
Class Timetable.ppsx
BharathiLakshmiAAssi
 
MAPEM.ppsx
MAPEM.ppsxMAPEM.ppsx

More from BharathiLakshmiAAssi (17)

VB.net&OOP.pptx
VB.net&OOP.pptxVB.net&OOP.pptx
VB.net&OOP.pptx
 
VB.netIDE.pptx
VB.netIDE.pptxVB.netIDE.pptx
VB.netIDE.pptx
 
VB.Net-Introduction.ppt
VB.Net-Introduction.pptVB.Net-Introduction.ppt
VB.Net-Introduction.ppt
 
File Allocation Methods.ppt
File Allocation Methods.pptFile Allocation Methods.ppt
File Allocation Methods.ppt
 
Virtual Memory.pptx
Virtual Memory.pptxVirtual Memory.pptx
Virtual Memory.pptx
 
Knowing about Computer SS.pptx
Knowing about Computer SS.pptxKnowing about Computer SS.pptx
Knowing about Computer SS.pptx
 
Parallel Computing--Webminar.ppsx
Parallel Computing--Webminar.ppsxParallel Computing--Webminar.ppsx
Parallel Computing--Webminar.ppsx
 
MAPEM.ppsx
MAPEM.ppsxMAPEM.ppsx
MAPEM.ppsx
 
Iterative Algorithms.ppsx
Iterative Algorithms.ppsxIterative Algorithms.ppsx
Iterative Algorithms.ppsx
 
Intensity Transformation.ppsx
Intensity Transformation.ppsxIntensity Transformation.ppsx
Intensity Transformation.ppsx
 
MAtrix Multiplication Parallel.ppsx
MAtrix Multiplication Parallel.ppsxMAtrix Multiplication Parallel.ppsx
MAtrix Multiplication Parallel.ppsx
 
Web Designing.ppsx
Web Designing.ppsxWeb Designing.ppsx
Web Designing.ppsx
 
Graphics Designing-Intro.ppsx
Graphics Designing-Intro.ppsxGraphics Designing-Intro.ppsx
Graphics Designing-Intro.ppsx
 
Intensity Transformation & Spatial Filtering.ppsx
Intensity Transformation & Spatial Filtering.ppsxIntensity Transformation & Spatial Filtering.ppsx
Intensity Transformation & Spatial Filtering.ppsx
 
DIP Slide Share.ppsx
DIP Slide Share.ppsxDIP Slide Share.ppsx
DIP Slide Share.ppsx
 
Class Timetable.ppsx
Class Timetable.ppsxClass Timetable.ppsx
Class Timetable.ppsx
 
MAPEM.ppsx
MAPEM.ppsxMAPEM.ppsx
MAPEM.ppsx
 

Recently uploaded

Getting started with Amazon Bedrock Studio and Control Tower
Getting started with Amazon Bedrock Studio and Control TowerGetting started with Amazon Bedrock Studio and Control Tower
Getting started with Amazon Bedrock Studio and Control Tower
Vladimir Samoylov
 
International Workshop on Artificial Intelligence in Software Testing
International Workshop on Artificial Intelligence in Software TestingInternational Workshop on Artificial Intelligence in Software Testing
International Workshop on Artificial Intelligence in Software Testing
Sebastiano Panichella
 
Supercharge your AI - SSP Industry Breakout Session 2024-v2_1.pdf
Supercharge your AI - SSP Industry Breakout Session 2024-v2_1.pdfSupercharge your AI - SSP Industry Breakout Session 2024-v2_1.pdf
Supercharge your AI - SSP Industry Breakout Session 2024-v2_1.pdf
Access Innovations, Inc.
 
somanykidsbutsofewfathers-140705000023-phpapp02.pptx
somanykidsbutsofewfathers-140705000023-phpapp02.pptxsomanykidsbutsofewfathers-140705000023-phpapp02.pptx
somanykidsbutsofewfathers-140705000023-phpapp02.pptx
Howard Spence
 
Sharpen existing tools or get a new toolbox? Contemporary cluster initiatives...
Sharpen existing tools or get a new toolbox? Contemporary cluster initiatives...Sharpen existing tools or get a new toolbox? Contemporary cluster initiatives...
Sharpen existing tools or get a new toolbox? Contemporary cluster initiatives...
Orkestra
 
María Carolina Martínez - eCommerce Day Colombia 2024
María Carolina Martínez - eCommerce Day Colombia 2024María Carolina Martínez - eCommerce Day Colombia 2024
María Carolina Martínez - eCommerce Day Colombia 2024
eCommerce Institute
 
Bitcoin Lightning wallet and tic-tac-toe game XOXO
Bitcoin Lightning wallet and tic-tac-toe game XOXOBitcoin Lightning wallet and tic-tac-toe game XOXO
Bitcoin Lightning wallet and tic-tac-toe game XOXO
Matjaž Lipuš
 
Acorn Recovery: Restore IT infra within minutes
Acorn Recovery: Restore IT infra within minutesAcorn Recovery: Restore IT infra within minutes
Acorn Recovery: Restore IT infra within minutes
IP ServerOne
 
0x01 - Newton's Third Law: Static vs. Dynamic Abusers
0x01 - Newton's Third Law:  Static vs. Dynamic Abusers0x01 - Newton's Third Law:  Static vs. Dynamic Abusers
0x01 - Newton's Third Law: Static vs. Dynamic Abusers
OWASP Beja
 
Announcement of 18th IEEE International Conference on Software Testing, Verif...
Announcement of 18th IEEE International Conference on Software Testing, Verif...Announcement of 18th IEEE International Conference on Software Testing, Verif...
Announcement of 18th IEEE International Conference on Software Testing, Verif...
Sebastiano Panichella
 
Bonzo subscription_hjjjjjjjj5hhhhhhh_2024.pdf
Bonzo subscription_hjjjjjjjj5hhhhhhh_2024.pdfBonzo subscription_hjjjjjjjj5hhhhhhh_2024.pdf
Bonzo subscription_hjjjjjjjj5hhhhhhh_2024.pdf
khadija278284
 
Eureka, I found it! - Special Libraries Association 2021 Presentation
Eureka, I found it! - Special Libraries Association 2021 PresentationEureka, I found it! - Special Libraries Association 2021 Presentation
Eureka, I found it! - Special Libraries Association 2021 Presentation
Access Innovations, Inc.
 
Doctoral Symposium at the 17th IEEE International Conference on Software Test...
Doctoral Symposium at the 17th IEEE International Conference on Software Test...Doctoral Symposium at the 17th IEEE International Conference on Software Test...
Doctoral Symposium at the 17th IEEE International Conference on Software Test...
Sebastiano Panichella
 
Competition and Regulation in Professional Services – KLEINER – June 2024 OEC...
Competition and Regulation in Professional Services – KLEINER – June 2024 OEC...Competition and Regulation in Professional Services – KLEINER – June 2024 OEC...
Competition and Regulation in Professional Services – KLEINER – June 2024 OEC...
OECD Directorate for Financial and Enterprise Affairs
 
Media as a Mind Controlling Strategy In Old and Modern Era
Media as a Mind Controlling Strategy In Old and Modern EraMedia as a Mind Controlling Strategy In Old and Modern Era
Media as a Mind Controlling Strategy In Old and Modern Era
faizulhassanfaiz1670
 
Obesity causes and management and associated medical conditions
Obesity causes and management and associated medical conditionsObesity causes and management and associated medical conditions
Obesity causes and management and associated medical conditions
Faculty of Medicine And Health Sciences
 

Recently uploaded (16)

Getting started with Amazon Bedrock Studio and Control Tower
Getting started with Amazon Bedrock Studio and Control TowerGetting started with Amazon Bedrock Studio and Control Tower
Getting started with Amazon Bedrock Studio and Control Tower
 
International Workshop on Artificial Intelligence in Software Testing
International Workshop on Artificial Intelligence in Software TestingInternational Workshop on Artificial Intelligence in Software Testing
International Workshop on Artificial Intelligence in Software Testing
 
Supercharge your AI - SSP Industry Breakout Session 2024-v2_1.pdf
Supercharge your AI - SSP Industry Breakout Session 2024-v2_1.pdfSupercharge your AI - SSP Industry Breakout Session 2024-v2_1.pdf
Supercharge your AI - SSP Industry Breakout Session 2024-v2_1.pdf
 
somanykidsbutsofewfathers-140705000023-phpapp02.pptx
somanykidsbutsofewfathers-140705000023-phpapp02.pptxsomanykidsbutsofewfathers-140705000023-phpapp02.pptx
somanykidsbutsofewfathers-140705000023-phpapp02.pptx
 
Sharpen existing tools or get a new toolbox? Contemporary cluster initiatives...
Sharpen existing tools or get a new toolbox? Contemporary cluster initiatives...Sharpen existing tools or get a new toolbox? Contemporary cluster initiatives...
Sharpen existing tools or get a new toolbox? Contemporary cluster initiatives...
 
María Carolina Martínez - eCommerce Day Colombia 2024
María Carolina Martínez - eCommerce Day Colombia 2024María Carolina Martínez - eCommerce Day Colombia 2024
María Carolina Martínez - eCommerce Day Colombia 2024
 
Bitcoin Lightning wallet and tic-tac-toe game XOXO
Bitcoin Lightning wallet and tic-tac-toe game XOXOBitcoin Lightning wallet and tic-tac-toe game XOXO
Bitcoin Lightning wallet and tic-tac-toe game XOXO
 
Acorn Recovery: Restore IT infra within minutes
Acorn Recovery: Restore IT infra within minutesAcorn Recovery: Restore IT infra within minutes
Acorn Recovery: Restore IT infra within minutes
 
0x01 - Newton's Third Law: Static vs. Dynamic Abusers
0x01 - Newton's Third Law:  Static vs. Dynamic Abusers0x01 - Newton's Third Law:  Static vs. Dynamic Abusers
0x01 - Newton's Third Law: Static vs. Dynamic Abusers
 
Announcement of 18th IEEE International Conference on Software Testing, Verif...
Announcement of 18th IEEE International Conference on Software Testing, Verif...Announcement of 18th IEEE International Conference on Software Testing, Verif...
Announcement of 18th IEEE International Conference on Software Testing, Verif...
 
Bonzo subscription_hjjjjjjjj5hhhhhhh_2024.pdf
Bonzo subscription_hjjjjjjjj5hhhhhhh_2024.pdfBonzo subscription_hjjjjjjjj5hhhhhhh_2024.pdf
Bonzo subscription_hjjjjjjjj5hhhhhhh_2024.pdf
 
Eureka, I found it! - Special Libraries Association 2021 Presentation
Eureka, I found it! - Special Libraries Association 2021 PresentationEureka, I found it! - Special Libraries Association 2021 Presentation
Eureka, I found it! - Special Libraries Association 2021 Presentation
 
Doctoral Symposium at the 17th IEEE International Conference on Software Test...
Doctoral Symposium at the 17th IEEE International Conference on Software Test...Doctoral Symposium at the 17th IEEE International Conference on Software Test...
Doctoral Symposium at the 17th IEEE International Conference on Software Test...
 
Competition and Regulation in Professional Services – KLEINER – June 2024 OEC...
Competition and Regulation in Professional Services – KLEINER – June 2024 OEC...Competition and Regulation in Professional Services – KLEINER – June 2024 OEC...
Competition and Regulation in Professional Services – KLEINER – June 2024 OEC...
 
Media as a Mind Controlling Strategy In Old and Modern Era
Media as a Mind Controlling Strategy In Old and Modern EraMedia as a Mind Controlling Strategy In Old and Modern Era
Media as a Mind Controlling Strategy In Old and Modern Era
 
Obesity causes and management and associated medical conditions
Obesity causes and management and associated medical conditionsObesity causes and management and associated medical conditions
Obesity causes and management and associated medical conditions
 

Demand Paging.pptx

  • 2. Demand Paging  Could bring entire process into memory at load time  Or bring a page into memory only when it is needed  Less I/O needed, no unnecessary I/O  Less memory needed  Faster response  More users  Similar to paging system with swapping (diagram on right)  Page is needed  reference to it  invalid reference  abort  not-in-memory  bring to memory  Lazy swapper – never swaps a page into memory unless page will be needed  Swapper that deals with pages is a pager
  • 3. Basic Concepts  With swapping, pager guesses which pages will be used before swapping out again  Instead, pager brings in only those pages into memory  How to determine that set of pages?  Need new MMU functionality to implement demand paging  If pages needed are already memory resident  No difference from non demand-paging  If page needed and not memory resident  Need to detect and load the page into memory from storage  Without changing program behavior  Without programmer needing to change code
  • 4. Valid-Invalid Bit  With each page table entry a valid–invalid bit is associated (v  in-memory – memory resident, i  not-in-memory)  Initially valid–invalid bit is set to i on all entries  Example of a page table snapshot:  During MMU address translation, if valid–invalid bit in page table entry is i  page fault
  • 5. Page Table When Some Pages Are Not in Main Memory
  • 6. Page Fault  If there is a reference to a page, first reference to that page will trap to operating system: page fault 1. Operating system looks at another table to decide:  Invalid reference  abort  Just not in memory 2. Find free frame 3. Swap page into frame via scheduled disk operation 4. Reset tables to indicate page now in memory Set validation bit = v 5. Restart the instruction that caused the page fault