SlideShare uma empresa Scribd logo
1 de 12
Baixar para ler offline
Virtual
Memory
Overview
●

Background

●

Demand Paging

●

Process Creation

●

Page Replacement

Operating System 2011/2012
Background
Virtual memory – separation of user logical memory from
physical memory.
●
●

●
●

Only part of the program needs to be in memory for execution.
Logical address space can therefore be much larger than physical
address space.
Allows address spaces to be shared by several processes.
Allows for more efficient process creation.

Operating System 2011/2012
Virtual to physical mapping

Operating System 2011/2012
Demand Page
Bring a page into memory only when it is needed.
●
Less I/O needed
●
Less memory needed
●
Faster response
●
More users

Page is needed → reference to it
invalid reference → abort
not-in-memory → bring to memory
●
●

Operating System 2011/2012
Transfer page

Operating System 2011/2012
Valid/Invalid Bit
With each page table entry a valid–invalid bit is associated
(1 → in-memory, → not-in-memory)
●
Initially valid–invalid but is set to 0 on all entries.
●
Example of a page table snapshot.
●
During address translation, if valid–invalid bit in page table
entry is 0 ⇒ page fault.
●

Operating System 2011/2012
Valid/Invalid Bit

Operating System 2011/2012
Page Fault

Operating System 2011/2012
Memory full
●

Page replacement – find some page in memory, but not
really in use, swap it out.
●
●

●

algorithm
performance – want an algorithm which will result in minimum
number of page faults.

Same page may be brought into memory several times.

Operating System 2011/2012
Copy-on-Write
Copy-on-Write (COW) allows both parent and child processes to initially
share the same pages in memory.

If either process modifies a shared page, only then is the page
copied.
COW allows more efficient process creation as only modified
pages are copied.
Free pages are allocated from a pool of zeroed-out pages.

Operating System 2011/2012
Page replacement
●

FIFO Page Replacement

●

Optimal Page Replacement

●

LRU Page Replacement

●

LRU – Approximation Page Replacement
●
●

●

Additional-Reference-Bits Algorithm
Second-Chance Algorithm

Counting-Based Page Replacement
●
●

least-frequently-used (LFU)
most-frequently-used (MFU)

Operating System 2011/2012

Mais conteúdo relacionado

Mais procurados

40 demand paging
40 demand paging40 demand paging
40 demand paging
myrajendra
 

Mais procurados (18)

Ch9 Virtual Memory
Ch9 Virtual MemoryCh9 Virtual Memory
Ch9 Virtual Memory
 
virtual memory
virtual memoryvirtual memory
virtual memory
 
Virtual Memory
Virtual MemoryVirtual Memory
Virtual Memory
 
Mem mgt
Mem mgtMem mgt
Mem mgt
 
virtual memory
virtual memoryvirtual memory
virtual memory
 
Virtual memory - Demand Paging
Virtual memory - Demand PagingVirtual memory - Demand Paging
Virtual memory - Demand Paging
 
Virtual Memory ,Direct memory addressing and indirect memory addressing prese...
Virtual Memory ,Direct memory addressing and indirect memory addressing prese...Virtual Memory ,Direct memory addressing and indirect memory addressing prese...
Virtual Memory ,Direct memory addressing and indirect memory addressing prese...
 
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
Page replacementPage replacement
Page replacement
 
Page replacement
Page replacementPage replacement
Page replacement
 
Virtual Memory Management
Virtual Memory ManagementVirtual Memory Management
Virtual Memory Management
 
Virtual Memory in Operating System
Virtual Memory in Operating SystemVirtual Memory in Operating System
Virtual Memory in Operating System
 
Operating Systems - Virtual Memory
Operating Systems - Virtual MemoryOperating Systems - Virtual Memory
Operating Systems - Virtual Memory
 
Virtual memory
Virtual memoryVirtual memory
Virtual memory
 
Virtual Memory in Windows
Virtual Memory in Windows Virtual Memory in Windows
Virtual Memory in Windows
 
Virtual memory and page replacement algorithm
Virtual memory and page replacement algorithmVirtual memory and page replacement algorithm
Virtual memory and page replacement algorithm
 
OSCh10
OSCh10OSCh10
OSCh10
 
40 demand paging
40 demand paging40 demand paging
40 demand paging
 

Destaque

Understanding operating systems 5th ed ch04
Understanding operating systems 5th ed ch04Understanding operating systems 5th ed ch04
Understanding operating systems 5th ed ch04
BarrBoy
 
Understanding operating systems 5th ed ch01
Understanding operating systems 5th ed ch01Understanding operating systems 5th ed ch01
Understanding operating systems 5th ed ch01
BarrBoy
 
Understanding operating systems 5th ed ch03
Understanding operating systems 5th ed ch03Understanding operating systems 5th ed ch03
Understanding operating systems 5th ed ch03
BarrBoy
 
Batch Scripting with Drupal (Featuring the EntityFieldQuery API)
Batch Scripting with Drupal (Featuring the EntityFieldQuery API)Batch Scripting with Drupal (Featuring the EntityFieldQuery API)
Batch Scripting with Drupal (Featuring the EntityFieldQuery API)
Ranel Padon
 
charles_long Linkedin
charles_long Linkedincharles_long Linkedin
charles_long Linkedin
Charles Long
 
Understanding operating systems 5th ed ch07
Understanding operating systems 5th ed ch07Understanding operating systems 5th ed ch07
Understanding operating systems 5th ed ch07
BarrBoy
 
Understanding operating systems 5th ed ch12
Understanding operating systems 5th ed ch12Understanding operating systems 5th ed ch12
Understanding operating systems 5th ed ch12
BarrBoy
 
Lesson 2 - Understanding Operating System Configurations
Lesson 2 - Understanding Operating System ConfigurationsLesson 2 - Understanding Operating System Configurations
Lesson 2 - Understanding Operating System Configurations
Gene Carboni
 
Memory management early_systems
Memory management early_systemsMemory management early_systems
Memory management early_systems
Mybej Che
 
Computer system, devices and peripherals
Computer system, devices and peripheralsComputer system, devices and peripherals
Computer system, devices and peripherals
Rojen Sabile
 

Destaque (20)

Understanding operating systems 5th ed ch04
Understanding operating systems 5th ed ch04Understanding operating systems 5th ed ch04
Understanding operating systems 5th ed ch04
 
Understanding operating systems 5th ed ch01
Understanding operating systems 5th ed ch01Understanding operating systems 5th ed ch01
Understanding operating systems 5th ed ch01
 
Understanding operating systems 5th ed ch03
Understanding operating systems 5th ed ch03Understanding operating systems 5th ed ch03
Understanding operating systems 5th ed ch03
 
Operating System Presentation
Operating System PresentationOperating System Presentation
Operating System Presentation
 
Batch Scripting with Drupal (Featuring the EntityFieldQuery API)
Batch Scripting with Drupal (Featuring the EntityFieldQuery API)Batch Scripting with Drupal (Featuring the EntityFieldQuery API)
Batch Scripting with Drupal (Featuring the EntityFieldQuery API)
 
Multitasking in the Emergency Communications Environment
Multitasking in the Emergency Communications EnvironmentMultitasking in the Emergency Communications Environment
Multitasking in the Emergency Communications Environment
 
charles_long Linkedin
charles_long Linkedincharles_long Linkedin
charles_long Linkedin
 
Operating systems
Operating systemsOperating systems
Operating systems
 
Toughest Things First & Normative Multi-Tasking - Aditya Yadav
Toughest Things First & Normative Multi-Tasking - Aditya YadavToughest Things First & Normative Multi-Tasking - Aditya Yadav
Toughest Things First & Normative Multi-Tasking - Aditya Yadav
 
Understanding operating systems 5th ed ch07
Understanding operating systems 5th ed ch07Understanding operating systems 5th ed ch07
Understanding operating systems 5th ed ch07
 
Understanding operating systems 5th ed ch12
Understanding operating systems 5th ed ch12Understanding operating systems 5th ed ch12
Understanding operating systems 5th ed ch12
 
An Introduction to Operating Systems
An Introduction to Operating SystemsAn Introduction to Operating Systems
An Introduction to Operating Systems
 
Lesson 2 - Understanding Operating System Configurations
Lesson 2 - Understanding Operating System ConfigurationsLesson 2 - Understanding Operating System Configurations
Lesson 2 - Understanding Operating System Configurations
 
How to hack the web
How to hack the webHow to hack the web
How to hack the web
 
Basic vbscript for qtp
Basic vbscript for qtpBasic vbscript for qtp
Basic vbscript for qtp
 
Memory management early_systems
Memory management early_systemsMemory management early_systems
Memory management early_systems
 
Ch01 introducing operating systems
Ch01 introducing operating systemsCh01 introducing operating systems
Ch01 introducing operating systems
 
Computer system, devices and peripherals
Computer system, devices and peripheralsComputer system, devices and peripherals
Computer system, devices and peripherals
 
Ch02 early system memory management
Ch02 early system  memory managementCh02 early system  memory management
Ch02 early system memory management
 
Difference between Single core, Dual core and Quad core Processors
Difference between Single core, Dual core and Quad core ProcessorsDifference between Single core, Dual core and Quad core Processors
Difference between Single core, Dual core and Quad core Processors
 

Semelhante a Virtual Memory

Semelhante a Virtual Memory (20)

Main Memory
Main MemoryMain Memory
Main Memory
 
ch9_virMem.pdf
ch9_virMem.pdfch9_virMem.pdf
ch9_virMem.pdf
 
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
 
Chapter 10 Operating Systems silberschatz
Chapter 10 Operating Systems silberschatzChapter 10 Operating Systems silberschatz
Chapter 10 Operating Systems silberschatz
 
Ch8 of OS
Ch8 of OSCh8 of OS
Ch8 of OS
 
Computer architecture virtual memory
Computer architecture virtual memoryComputer architecture virtual memory
Computer architecture virtual memory
 
Virtual memory
Virtual memoryVirtual memory
Virtual memory
 
Operating System
Operating SystemOperating System
Operating System
 
CSL Seminar presented by Cassiano Campes - 16-11-14
CSL Seminar presented by Cassiano Campes - 16-11-14CSL Seminar presented by Cassiano Campes - 16-11-14
CSL Seminar presented by Cassiano Campes - 16-11-14
 
Chap8 Virtual Memory. 1997-2003.ppt
Chap8 Virtual Memory. 1997-2003.pptChap8 Virtual Memory. 1997-2003.ppt
Chap8 Virtual Memory. 1997-2003.ppt
 
Virtual Memory 53565686598386865286860.pdf
Virtual Memory 53565686598386865286860.pdfVirtual Memory 53565686598386865286860.pdf
Virtual Memory 53565686598386865286860.pdf
 
Virtual Memory (1).pptx
Virtual Memory (1).pptxVirtual Memory (1).pptx
Virtual Memory (1).pptx
 
Ch8
Ch8Ch8
Ch8
 
CH09.pdf
CH09.pdfCH09.pdf
CH09.pdf
 
Chapter 11 from Operating system by silberschartz
Chapter 11 from Operating system by silberschartzChapter 11 from Operating system by silberschartz
Chapter 11 from Operating system by silberschartz
 
بيي
بييبيي
بيي
 
Memory Management
 Memory Management Memory Management
Memory Management
 
Mca ii os u-4 memory management
Mca  ii  os u-4 memory managementMca  ii  os u-4 memory management
Mca ii os u-4 memory management
 
CSI-503 - 9. Virtual Memory
CSI-503 - 9. Virtual MemoryCSI-503 - 9. Virtual Memory
CSI-503 - 9. Virtual Memory
 
Ch9
Ch9Ch9
Ch9
 

Mais de Mustafa Ugur Oduncu (7)

Windows server 2008
Windows server 2008 Windows server 2008
Windows server 2008
 
Shared Memory
Shared MemoryShared Memory
Shared Memory
 
Scheduling
SchedulingScheduling
Scheduling
 
Thread
ThreadThread
Thread
 
Processes
ProcessesProcesses
Processes
 
Operating Systems
Operating SystemsOperating Systems
Operating Systems
 
Linux fundamentals
Linux fundamentalsLinux fundamentals
Linux fundamentals
 

Último

Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
panagenda
 
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc
 
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider  Progress from Awareness to Implementation.pptxTales from a Passkey Provider  Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
FIDO Alliance
 
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
FIDO Alliance
 
CORS (Kitworks Team Study 양다윗 발표자료 240510)
CORS (Kitworks Team Study 양다윗 발표자료 240510)CORS (Kitworks Team Study 양다윗 발표자료 240510)
CORS (Kitworks Team Study 양다윗 발표자료 240510)
Wonjun Hwang
 

Último (20)

Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
 
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
 
State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!
 
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
 
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider  Progress from Awareness to Implementation.pptxTales from a Passkey Provider  Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
 
Intro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptxIntro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptx
 
WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024
 
Frisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdf
Frisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdfFrisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdf
Frisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdf
 
Cyber Insurance - RalphGilot - Embry-Riddle Aeronautical University.pptx
Cyber Insurance - RalphGilot - Embry-Riddle Aeronautical University.pptxCyber Insurance - RalphGilot - Embry-Riddle Aeronautical University.pptx
Cyber Insurance - RalphGilot - Embry-Riddle Aeronautical University.pptx
 
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
 
ChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps ProductivityChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps Productivity
 
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
 
ERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage IntacctERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage Intacct
 
Design and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data ScienceDesign and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data Science
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
CORS (Kitworks Team Study 양다윗 발표자료 240510)
CORS (Kitworks Team Study 양다윗 발표자료 240510)CORS (Kitworks Team Study 양다윗 발표자료 240510)
CORS (Kitworks Team Study 양다윗 발표자료 240510)
 
Introduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMIntroduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDM
 
Overview of Hyperledger Foundation
Overview of Hyperledger FoundationOverview of Hyperledger Foundation
Overview of Hyperledger Foundation
 
AI mind or machine power point presentation
AI mind or machine power point presentationAI mind or machine power point presentation
AI mind or machine power point presentation
 

Virtual Memory

  • 3. Background Virtual memory – separation of user logical memory from physical memory. ● ● ● ● Only part of the program needs to be in memory for execution. Logical address space can therefore be much larger than physical address space. Allows address spaces to be shared by several processes. Allows for more efficient process creation. Operating System 2011/2012
  • 4. Virtual to physical mapping Operating System 2011/2012
  • 5. Demand Page Bring a page into memory only when it is needed. ● Less I/O needed ● Less memory needed ● Faster response ● More users Page is needed → reference to it invalid reference → abort not-in-memory → bring to memory ● ● Operating System 2011/2012
  • 7. Valid/Invalid Bit With each page table entry a valid–invalid bit is associated (1 → in-memory, → not-in-memory) ● Initially valid–invalid but is set to 0 on all entries. ● Example of a page table snapshot. ● During address translation, if valid–invalid bit in page table entry is 0 ⇒ page fault. ● Operating System 2011/2012
  • 10. Memory full ● Page replacement – find some page in memory, but not really in use, swap it out. ● ● ● algorithm performance – want an algorithm which will result in minimum number of page faults. Same page may be brought into memory several times. Operating System 2011/2012
  • 11. Copy-on-Write Copy-on-Write (COW) allows both parent and child processes to initially share the same pages in memory. If either process modifies a shared page, only then is the page copied. COW allows more efficient process creation as only modified pages are copied. Free pages are allocated from a pool of zeroed-out pages. Operating System 2011/2012
  • 12. Page replacement ● FIFO Page Replacement ● Optimal Page Replacement ● LRU Page Replacement ● LRU – Approximation Page Replacement ● ● ● Additional-Reference-Bits Algorithm Second-Chance Algorithm Counting-Based Page Replacement ● ● least-frequently-used (LFU) most-frequently-used (MFU) Operating System 2011/2012