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

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Último (20)

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
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech 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 future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
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
 
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
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.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
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
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
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 

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