SlideShare una empresa de Scribd logo
1 de 12
Descargar para leer sin conexión
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

Más contenido relacionado

La actualidad más candente

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

La actualidad más candente (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
 

Destacado

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
 

Destacado (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
 

Similar a Virtual Memory

Similar 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
 

Más 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

EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 

Último (20)

Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 

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