SlideShare uma empresa Scribd logo
1 de 20
OPERATING SYSTEM
PANKAJ DEBBARMA
Deptt. of CSE, TIT, Narsingarh
Memory Management
CONTENTS
Virtual
Memory
• No memory abstraction
• Memory abstraction
• Swapping
• Managing free memory
• Virtual Memory
• Paging
• MMU Operation
• Page tables
• Speeding up paging
• Translation Lookaside Buffer
No Memory Abstraction
Figure 3-2. Illustration of the relocation
problem. (a) A 16-KB program. (b) Another
16-KB program. (c) The two programs
loaded consecutively into memory.
• Relocation
o Static
o Dynamic
Memory Abstraction
• Address Space: set of
addresses that a process can
use to address memory.
• Base and Limit Registers
– To avoid interference by
multiple applications
– Disadvantages
Figure 3-3.
Swapping
• Background
processes
Swapping
Figure 3-4. Memory allocation changes as processes come into
memory and leave it. The shaded regions are unused memory.
Swapping
• When swapping creates multiple holes in
memory, it is possible to combine them all
into one big on by moving all the processes
downward as far as possible. This technique is
known as memory compaction.
• Issues related to memory compaction.
Managing Free Memory
Figure 3-6. (a) A part of memory with five processes and three holes. The tick
marks show the memory allocation units. The shaded regions (0 in the bitmap)
are free. (b) The corresponding bitmap. (c) The same information as a list.
Managing Free Memory
Figure 3-7. Four neighbour combinations for
the terminating process, X.
Virtual Memory
• Increase in memory size.
• Overlays, programs split into pieces.
– Overlay Manager.
– Time consuming, boring, and error prone.
• Virtual memory
• Pages
– Each page is a contiguous range of addresses.
– Pages are mapped onto physical memory.
Paging
Virtual Addresses | Virtual Address Space | Memory Management Unit
Figure 3-8.
Paging
• Pages
• Page tables
• Page frames
• Present/absent bit
• Page fault, MMU notices that the
page is unmapped and causes the
CPU to trap to the OS
Figure 3-9. The relation between virtual
addresses and physical memory addresses
is given by the page table. Every page
begins on a multiple of 4096 and ends
4095 addresses higher, so 4K–8K really
means 4096–8191 and 8K to 12 K means
8192–12287.
MMU Operation
Figure 3-10. The internal
operation of the MMU with
16 4-KB pages.
Paging, numerical
If capacity of physical memory is ‘m’ and the size of each page is ‘p’
then the number of frames in the physical memory will be
Q1. Consider a logical address space of eight pages of 1024 words,
each mapped onto a physical memory of 32 frames, then
(i) How many bits are in the logical address? Ans. 13
(ii) How many bits are in the physical address? Ans. 15
Q2. How many pages will be required to convert a logical address of 18
bits into physical address during mapping if the size of each page is
1K? Ans. 28
Page Tables
• Present/absent bit. If bit is 1, entry is valid, can be used.
Accessing with bit set to 0 causes a page fault.
• Protection bits. 0 for read/write and 1 for read only.
• Modified. dirty = write back; clean = abandon.
• Referenced. Helps in setting priority for eviction.
Figure 3-11. A typical page table entry.
Speeding Up Paging
Major issues
• The mapping from virtual address to physical
address must be fast.
• If the virtual address space is large, the page
table will be large.
Translation Lookaside Buffer
Figure 3-12. A TLB to speed up paging.
Translation Lookaside Buffer
• If a computer system takes t1 time to access TLB and t2 time
to access memory then mapped memory access will take
t1+t2 time when page number is present in TLB.
• And when page number is not present in TLB then we
require t1 time to access TLB in which page number is not
present and t1’ time to access TLB and then t2 time to
access memory.
• So we require total t1+t1’+t2 time when page no. is not
present in TLB. To find the effective access time, we must
weigh each case by its probability as:
Teff = hit ratio * (t1 + t2) + miss ratio * (t1 + t1’ + t2)
Translation Lookaside Buffer
Q. Consider a paging system with the page table store in
memory.
(i) If a memory takes 200 nanoseconds, how long does a
paged memory reference take? Ans. 200ns
(ii) If we need TLBs and 75 percent of all page table reference
are found in the TLBs, what is the effective reference
time? (Assume that finding a page-table entry in TLBs
takes zero time, if the entry is there) Ans. 250ns
OS-01 Virtual Memory.pptx

Mais conteúdo relacionado

Semelhante a OS-01 Virtual Memory.pptx

C++ Advanced Memory Management With Allocators
C++ Advanced Memory Management With AllocatorsC++ Advanced Memory Management With Allocators
C++ Advanced Memory Management With AllocatorsGlobalLogic Ukraine
 
Memory Management Strategies - III.pdf
Memory Management Strategies - III.pdfMemory Management Strategies - III.pdf
Memory Management Strategies - III.pdfHarika Pudugosula
 
Segmentation with paging methods and techniques
Segmentation with paging methods and techniquesSegmentation with paging methods and techniques
Segmentation with paging methods and techniquesnikhilrana24112003
 
Implementation of page table
Implementation of page tableImplementation of page table
Implementation of page tableguestff64339
 
MapReduce:Simplified Data Processing on Large Cluster Presented by Areej Qas...
MapReduce:Simplified Data Processing on Large Cluster  Presented by Areej Qas...MapReduce:Simplified Data Processing on Large Cluster  Presented by Areej Qas...
MapReduce:Simplified Data Processing on Large Cluster Presented by Areej Qas...areej qasrawi
 
Main Memory Management in Operating System
Main Memory Management in Operating SystemMain Memory Management in Operating System
Main Memory Management in Operating SystemRashmi Bhat
 
Lecture 8- Virtual Memory Final.pptx
Lecture 8- Virtual Memory Final.pptxLecture 8- Virtual Memory Final.pptx
Lecture 8- Virtual Memory Final.pptxAmanuelmergia
 
In datacenter performance analysis of a tensor processing unit
In datacenter performance analysis of a tensor processing unitIn datacenter performance analysis of a tensor processing unit
In datacenter performance analysis of a tensor processing unitJinwon Lee
 
Week-13-Memory Managementggvgjjjbbbb.ppt
Week-13-Memory Managementggvgjjjbbbb.pptWeek-13-Memory Managementggvgjjjbbbb.ppt
Week-13-Memory Managementggvgjjjbbbb.pptTanyaSharma662971
 
The Dark Side Of Go -- Go runtime related problems in TiDB in production
The Dark Side Of Go -- Go runtime related problems in TiDB  in productionThe Dark Side Of Go -- Go runtime related problems in TiDB  in production
The Dark Side Of Go -- Go runtime related problems in TiDB in productionPingCAP
 
Virtual memory translation.pptx
Virtual memory translation.pptxVirtual memory translation.pptx
Virtual memory translation.pptxRAJESH S
 
The All-In-One Package for Massively Multicore, Heterogeneous Jobs with Hotsp...
The All-In-One Package for Massively Multicore, Heterogeneous Jobs with Hotsp...The All-In-One Package for Massively Multicore, Heterogeneous Jobs with Hotsp...
The All-In-One Package for Massively Multicore, Heterogeneous Jobs with Hotsp...Tokyo University of Science
 

Semelhante a OS-01 Virtual Memory.pptx (20)

C++ Advanced Memory Management With Allocators
C++ Advanced Memory Management With AllocatorsC++ Advanced Memory Management With Allocators
C++ Advanced Memory Management With Allocators
 
Memory Management Strategies - III.pdf
Memory Management Strategies - III.pdfMemory Management Strategies - III.pdf
Memory Management Strategies - III.pdf
 
Segmentation with paging methods and techniques
Segmentation with paging methods and techniquesSegmentation with paging methods and techniques
Segmentation with paging methods and techniques
 
Os4
Os4Os4
Os4
 
Os4
Os4Os4
Os4
 
Implementation of page table
Implementation of page tableImplementation of page table
Implementation of page table
 
MapReduce:Simplified Data Processing on Large Cluster Presented by Areej Qas...
MapReduce:Simplified Data Processing on Large Cluster  Presented by Areej Qas...MapReduce:Simplified Data Processing on Large Cluster  Presented by Areej Qas...
MapReduce:Simplified Data Processing on Large Cluster Presented by Areej Qas...
 
Main Memory Management in Operating System
Main Memory Management in Operating SystemMain Memory Management in Operating System
Main Memory Management in Operating System
 
Lecture 8- Virtual Memory Final.pptx
Lecture 8- Virtual Memory Final.pptxLecture 8- Virtual Memory Final.pptx
Lecture 8- Virtual Memory Final.pptx
 
In datacenter performance analysis of a tensor processing unit
In datacenter performance analysis of a tensor processing unitIn datacenter performance analysis of a tensor processing unit
In datacenter performance analysis of a tensor processing unit
 
Week-13-Memory Managementggvgjjjbbbb.ppt
Week-13-Memory Managementggvgjjjbbbb.pptWeek-13-Memory Managementggvgjjjbbbb.ppt
Week-13-Memory Managementggvgjjjbbbb.ppt
 
Segmentation and paging
Segmentation and paging Segmentation and paging
Segmentation and paging
 
The Dark Side Of Go -- Go runtime related problems in TiDB in production
The Dark Side Of Go -- Go runtime related problems in TiDB  in productionThe Dark Side Of Go -- Go runtime related problems in TiDB  in production
The Dark Side Of Go -- Go runtime related problems in TiDB in production
 
Memory management
Memory managementMemory management
Memory management
 
Virtual memory translation.pptx
Virtual memory translation.pptxVirtual memory translation.pptx
Virtual memory translation.pptx
 
Mca ppt
Mca pptMca ppt
Mca ppt
 
Homework solutionsch8
Homework solutionsch8Homework solutionsch8
Homework solutionsch8
 
The All-In-One Package for Massively Multicore, Heterogeneous Jobs with Hotsp...
The All-In-One Package for Massively Multicore, Heterogeneous Jobs with Hotsp...The All-In-One Package for Massively Multicore, Heterogeneous Jobs with Hotsp...
The All-In-One Package for Massively Multicore, Heterogeneous Jobs with Hotsp...
 
virtual memory
virtual memoryvirtual memory
virtual memory
 
cache memory management
cache memory managementcache memory management
cache memory management
 

Mais de Pankaj Debbarma

AI-06 Search Techniques - Informed.pptx
AI-06 Search Techniques - Informed.pptxAI-06 Search Techniques - Informed.pptx
AI-06 Search Techniques - Informed.pptxPankaj Debbarma
 
AI-05 Search Algorithms.pptx
AI-05 Search Algorithms.pptxAI-05 Search Algorithms.pptx
AI-05 Search Algorithms.pptxPankaj Debbarma
 
CP03-Data Structures.pptx
CP03-Data Structures.pptxCP03-Data Structures.pptx
CP03-Data Structures.pptxPankaj Debbarma
 
AI-04 Production System - Search Problem.pptx
AI-04 Production System - Search Problem.pptxAI-04 Production System - Search Problem.pptx
AI-04 Production System - Search Problem.pptxPankaj Debbarma
 
AI-03 Problems State Space.pptx
AI-03 Problems State Space.pptxAI-03 Problems State Space.pptx
AI-03 Problems State Space.pptxPankaj Debbarma
 
CP02-Structure and Union.pptx
CP02-Structure and Union.pptxCP02-Structure and Union.pptx
CP02-Structure and Union.pptxPankaj Debbarma
 
Computer Graphics & Visualization - 06
Computer Graphics & Visualization - 06Computer Graphics & Visualization - 06
Computer Graphics & Visualization - 06Pankaj Debbarma
 
NETWORK LAYER - Logical Addressing
NETWORK LAYER - Logical AddressingNETWORK LAYER - Logical Addressing
NETWORK LAYER - Logical AddressingPankaj Debbarma
 
TRANSPORT LAYER - Process-to-Process Delivery: UDP, TCP and SCTP
TRANSPORT LAYER - Process-to-Process Delivery: UDP, TCP and SCTPTRANSPORT LAYER - Process-to-Process Delivery: UDP, TCP and SCTP
TRANSPORT LAYER - Process-to-Process Delivery: UDP, TCP and SCTPPankaj Debbarma
 

Mais de Pankaj Debbarma (17)

AI-09 Logic in AI
AI-09 Logic in AIAI-09 Logic in AI
AI-09 Logic in AI
 
OS-02 Segmentation.pptx
OS-02 Segmentation.pptxOS-02 Segmentation.pptx
OS-02 Segmentation.pptx
 
AI-08 Game Playing.pptx
AI-08 Game Playing.pptxAI-08 Game Playing.pptx
AI-08 Game Playing.pptx
 
AI-06 Search Techniques - Informed.pptx
AI-06 Search Techniques - Informed.pptxAI-06 Search Techniques - Informed.pptx
AI-06 Search Techniques - Informed.pptx
 
AI-05 Search Algorithms.pptx
AI-05 Search Algorithms.pptxAI-05 Search Algorithms.pptx
AI-05 Search Algorithms.pptx
 
CP03-Data Structures.pptx
CP03-Data Structures.pptxCP03-Data Structures.pptx
CP03-Data Structures.pptx
 
AI-04 Production System - Search Problem.pptx
AI-04 Production System - Search Problem.pptxAI-04 Production System - Search Problem.pptx
AI-04 Production System - Search Problem.pptx
 
AI-03 Problems State Space.pptx
AI-03 Problems State Space.pptxAI-03 Problems State Space.pptx
AI-03 Problems State Space.pptx
 
CP02-Structure and Union.pptx
CP02-Structure and Union.pptxCP02-Structure and Union.pptx
CP02-Structure and Union.pptx
 
Intelligent Agents
Intelligent AgentsIntelligent Agents
Intelligent Agents
 
CP01.pptx
CP01.pptxCP01.pptx
CP01.pptx
 
Computer Graphics & Visualization - 06
Computer Graphics & Visualization - 06Computer Graphics & Visualization - 06
Computer Graphics & Visualization - 06
 
HTTP and Email
HTTP and EmailHTTP and Email
HTTP and Email
 
Ppt World Wide Web
Ppt World Wide WebPpt World Wide Web
Ppt World Wide Web
 
Ppt congestion control
Ppt congestion controlPpt congestion control
Ppt congestion control
 
NETWORK LAYER - Logical Addressing
NETWORK LAYER - Logical AddressingNETWORK LAYER - Logical Addressing
NETWORK LAYER - Logical Addressing
 
TRANSPORT LAYER - Process-to-Process Delivery: UDP, TCP and SCTP
TRANSPORT LAYER - Process-to-Process Delivery: UDP, TCP and SCTPTRANSPORT LAYER - Process-to-Process Delivery: UDP, TCP and SCTP
TRANSPORT LAYER - Process-to-Process Delivery: UDP, TCP and SCTP
 

Último

Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Dr.Costas Sachpazis
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSISrknatarajan
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduitsrknatarajan
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlysanyuktamishra911
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...ranjana rawat
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performancesivaprakash250
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...RajaP95
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingrknatarajan
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college projectTonystark477637
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations120cr0395
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSRajkumarAkumalla
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 

Último (20)

Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduits
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
 
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college project
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 

OS-01 Virtual Memory.pptx

  • 1. OPERATING SYSTEM PANKAJ DEBBARMA Deptt. of CSE, TIT, Narsingarh Memory Management
  • 2. CONTENTS Virtual Memory • No memory abstraction • Memory abstraction • Swapping • Managing free memory • Virtual Memory • Paging • MMU Operation • Page tables • Speeding up paging • Translation Lookaside Buffer
  • 3. No Memory Abstraction Figure 3-2. Illustration of the relocation problem. (a) A 16-KB program. (b) Another 16-KB program. (c) The two programs loaded consecutively into memory. • Relocation o Static o Dynamic
  • 4. Memory Abstraction • Address Space: set of addresses that a process can use to address memory. • Base and Limit Registers – To avoid interference by multiple applications – Disadvantages Figure 3-3.
  • 6. Swapping Figure 3-4. Memory allocation changes as processes come into memory and leave it. The shaded regions are unused memory.
  • 7. Swapping • When swapping creates multiple holes in memory, it is possible to combine them all into one big on by moving all the processes downward as far as possible. This technique is known as memory compaction. • Issues related to memory compaction.
  • 8. Managing Free Memory Figure 3-6. (a) A part of memory with five processes and three holes. The tick marks show the memory allocation units. The shaded regions (0 in the bitmap) are free. (b) The corresponding bitmap. (c) The same information as a list.
  • 9. Managing Free Memory Figure 3-7. Four neighbour combinations for the terminating process, X.
  • 10. Virtual Memory • Increase in memory size. • Overlays, programs split into pieces. – Overlay Manager. – Time consuming, boring, and error prone. • Virtual memory • Pages – Each page is a contiguous range of addresses. – Pages are mapped onto physical memory.
  • 11. Paging Virtual Addresses | Virtual Address Space | Memory Management Unit Figure 3-8.
  • 12. Paging • Pages • Page tables • Page frames • Present/absent bit • Page fault, MMU notices that the page is unmapped and causes the CPU to trap to the OS Figure 3-9. The relation between virtual addresses and physical memory addresses is given by the page table. Every page begins on a multiple of 4096 and ends 4095 addresses higher, so 4K–8K really means 4096–8191 and 8K to 12 K means 8192–12287.
  • 13. MMU Operation Figure 3-10. The internal operation of the MMU with 16 4-KB pages.
  • 14. Paging, numerical If capacity of physical memory is ‘m’ and the size of each page is ‘p’ then the number of frames in the physical memory will be Q1. Consider a logical address space of eight pages of 1024 words, each mapped onto a physical memory of 32 frames, then (i) How many bits are in the logical address? Ans. 13 (ii) How many bits are in the physical address? Ans. 15 Q2. How many pages will be required to convert a logical address of 18 bits into physical address during mapping if the size of each page is 1K? Ans. 28
  • 15. Page Tables • Present/absent bit. If bit is 1, entry is valid, can be used. Accessing with bit set to 0 causes a page fault. • Protection bits. 0 for read/write and 1 for read only. • Modified. dirty = write back; clean = abandon. • Referenced. Helps in setting priority for eviction. Figure 3-11. A typical page table entry.
  • 16. Speeding Up Paging Major issues • The mapping from virtual address to physical address must be fast. • If the virtual address space is large, the page table will be large.
  • 17. Translation Lookaside Buffer Figure 3-12. A TLB to speed up paging.
  • 18. Translation Lookaside Buffer • If a computer system takes t1 time to access TLB and t2 time to access memory then mapped memory access will take t1+t2 time when page number is present in TLB. • And when page number is not present in TLB then we require t1 time to access TLB in which page number is not present and t1’ time to access TLB and then t2 time to access memory. • So we require total t1+t1’+t2 time when page no. is not present in TLB. To find the effective access time, we must weigh each case by its probability as: Teff = hit ratio * (t1 + t2) + miss ratio * (t1 + t1’ + t2)
  • 19. Translation Lookaside Buffer Q. Consider a paging system with the page table store in memory. (i) If a memory takes 200 nanoseconds, how long does a paged memory reference take? Ans. 200ns (ii) If we need TLBs and 75 percent of all page table reference are found in the TLBs, what is the effective reference time? (Assume that finding a page-table entry in TLBs takes zero time, if the entry is there) Ans. 250ns