SlideShare a Scribd company logo
VIRTUAL MEMORY
BY
TAMIZHARASI A
ASST PROFESSOR – CSE
RMD ENGINEERING COLLEGE
Virtual and Physical Memory
�Physical Memory: memory actually
available in the computer
�Virtual Memory: memory that the OS
allows a program to believe it has
�Physical Address: real location in
physical memory; identifies actual storage
�Virtual Address: conventional
addressing used by a program which the
OS must translate into a physical address
CPUCPU
regsregs
C
a
c
h
e
MemoryMemory diskdisk
size:
speed:
$/Mbyte:
line size:
32 B
1 ns
8 B
Register Cache Memory Disk Memory
32 KB-4MB
2 ns
$125/MB
32 B
1024 MB
30 ns
$0.20/MB
4 KB
100 GB
8 ms
$0.001/MB
larger, slower, cheaper
8 B 32 B 4 KB
cache virtual memory
if no enough space in main memory then secondary
storage devices is used.
the program is brought into the main memory while
needed.
the OS moves programs and data automatically
between the main memory and secondary storage referred
as virtual-memory techniques.
the addresses that the processor issues for either
instructions or data are called virtual or logical
addresses.
Memory management unit (MMU), translates virtual
addresses into physical addresses.
when the desired data (or instructions) are in the main
memory, these data are fetched.
if the data are not in the main memory, the MMU
causes the operating system to bring the data into the
memory from the disk.
transfer of data between the disk and the main memory
is performed using the DMA scheme.
Processor
Hardware
Addr Trans
Mechanism
Main
Memorya
a'
physical addressvirtual address part of the
on-chip
memory mgmt unit (MMU)
ADDRESS TRANSLATION
Pages:(basic unit of information)
Virtual and physical address spaces divided into equal-
sized blocks are called “pages” (both virtual and physical)
occupies contiguous main memory locations
ranges from 2K to 16K bytes in length.
should not be too small, bcoz the access time of a
magnetic disk is much longer than main memory.
if too large it is possible that a substantial portion of a
page may not be used.
Cache techniques and virtual -memory techniques are
very similar.
Each virtual address has
- virtual page number (high-order bits)
- offset (low-order bits) specifies the location of a
particular byte within a page.
Page table:
 has Information about the main memory location of
each page
like address where the page is stored and the current
status of the page.
An area in the main memory that can hold one page is
called a page frame.
 The starting address of the page table is kept in a
page table base register.
 By adding the virtual page number to the contents of
this register, the address of the corresponding entry in
the page table is obtained.
Computing Physical Address
Page Table Entry (PTE) provides information about page
if (valid bit = 1) then the page is in memory.
Use physical page number (PPN) to construct address
if (valid bit = 0) then the page is on disk
Page fault
control bits that describe the status of the page
one bit indicates the validity of the page, that is, whether
the page is actually loaded in the main memory.
Another bit indicates whether the page has been modified
during its residency in the memory.
Other control bits indicate various restrictions that may be
imposed on accessing the page.
Translation Lookaside Buffer (TLB):
 due large size of page table it is impossible to include in
MMU of processor. Hence, page table is kept in main
memory.
a copy of small portion of page can be a accommodated
within MMU using TLB
 A small cache consists of most recently accessed page
entries
 TLB must also include the virtual address of the entry.
Address translation of TLB:
If the page table entry is found in the TLB, the
physical address is obtained immediately.
else the required entry is obtained from the page table
in the main memory and the TLB is updated.
Page Fault:
if the requested page is not in the main memory, a
page fault is said to have occurred.
The whole page must be brought from the disk into
the memory before access can proceed.
MMU asks the OS to intervene by raising an
exception (interrupt).
active task is interrupted, and OS then copies the
requested page from the disk into the main memory and
returns control to the interrupted task, a long delay may
occur.
when the task resumes, either the execution of the
interrupted instruction must continue from the point of
interruption or the instruction must be restarted.
If a new page is brought from the disk when the main
memory is full, it must replace one of the resident pages.
 Least Recently Used is removed normally.
 A control bit that is set to 1 whenever the corresponding
page is referenced (accessed).
The average translation time can be reduced by including
one or more special registers that retain the virtual page
number and the physical page frame of the most recently
performed translations.
MEMORY MANAGEMENT REQUIREMENTS
 system space - OS routines
 user space -user application programs reside.
MMU uses a page table base register to determine the
address of the table to be used in the translation process.
by changing the contents of this regis-ter, OS can switch
from one space to another.
The physical main mem-ory is thus shared by the active
pages of the system space and several user spaces.
 can access only the pages that belong to one of these
spaces at any given time.
No program should be allowed to destroy either the
data or instructions of other programs in the memory.
The processor has two states:
Supervisor state
The processor is usually placed in the supervisor state
when OS routines are being executed and in the user
state to execute user programs.
User State
In the user state, some machine instructions cannot be
executed.
These privileged instructions, which include such
operations as modifying the page table base register, can
only be executed while the processor is in the supervisor
state.
Hence, a user program is prevented from accessing the
page tables of other user spaces or of the system space.
some application program have access to certain pages
belonging to another program.
OS can arrange this by causing these pages to appear
in both spaces.
The shared pages will therefore have entries in two
different page tables.
The control bits in each table entry can be sent to
control the access privileges granted to each program.
THANK YOU

More Related Content

What's hot

Virtual memory
Virtual memoryVirtual memory
Virtual memory
Anuj Modi
 
Cache memory
Cache memoryCache memory
Cache memory
Faiq Ali Sayed
 
Cache memory
Cache  memoryCache  memory
Cache memory
Prasenjit Dey
 
Memory organization
Memory organizationMemory organization
Memory organization
AL- AMIN
 
Cache memory
Cache memoryCache memory
Cache memory
George Thomas
 
Cache memory
Cache memoryCache memory
Cache memory
Anuj Modi
 
Memory Management in OS
Memory Management in OSMemory Management in OS
Memory Management in OS
Kumar Pritam
 
Virtual memory
Virtual memoryVirtual memory
Virtual memory
Rao Mubashar
 
Memory organisation ppt final presentation
Memory organisation ppt final presentationMemory organisation ppt final presentation
Memory organisation ppt final presentation
rockymani
 
Mainframe systems
Mainframe systemsMainframe systems
Memory Organization
Memory OrganizationMemory Organization
Memory Organization
Kamal Acharya
 
Virtual memory
Virtual memoryVirtual memory
Virtual memory
Muhammad Farooq
 
contiguous memory allocation.pptx
contiguous memory allocation.pptxcontiguous memory allocation.pptx
contiguous memory allocation.pptx
Rajapriya82
 
Virtual memory ppt
Virtual memory pptVirtual memory ppt
Limitations of memory system performance
Limitations of memory system performanceLimitations of memory system performance
Limitations of memory system performance
Syed Zaid Irshad
 
Von Neumann Architecture
Von Neumann Architecture   Von Neumann Architecture
Von Neumann Architecture
Lor Ham
 
COMPUTER ORGANIZATION NOTES Unit 5
COMPUTER ORGANIZATION NOTES Unit 5COMPUTER ORGANIZATION NOTES Unit 5
COMPUTER ORGANIZATION NOTES Unit 5
Dr.MAYA NAYAK
 
Demand paging
Demand pagingDemand paging
Demand paging
Trinity Dwarka
 
RAID
RAIDRAID
Evolution of os
Evolution of osEvolution of os
Evolution of os
janani thirupathi
 

What's hot (20)

Virtual memory
Virtual memoryVirtual memory
Virtual memory
 
Cache memory
Cache memoryCache memory
Cache memory
 
Cache memory
Cache  memoryCache  memory
Cache memory
 
Memory organization
Memory organizationMemory organization
Memory organization
 
Cache memory
Cache memoryCache memory
Cache memory
 
Cache memory
Cache memoryCache memory
Cache memory
 
Memory Management in OS
Memory Management in OSMemory Management in OS
Memory Management in OS
 
Virtual memory
Virtual memoryVirtual memory
Virtual memory
 
Memory organisation ppt final presentation
Memory organisation ppt final presentationMemory organisation ppt final presentation
Memory organisation ppt final presentation
 
Mainframe systems
Mainframe systemsMainframe systems
Mainframe systems
 
Memory Organization
Memory OrganizationMemory Organization
Memory Organization
 
Virtual memory
Virtual memoryVirtual memory
Virtual memory
 
contiguous memory allocation.pptx
contiguous memory allocation.pptxcontiguous memory allocation.pptx
contiguous memory allocation.pptx
 
Virtual memory ppt
Virtual memory pptVirtual memory ppt
Virtual memory ppt
 
Limitations of memory system performance
Limitations of memory system performanceLimitations of memory system performance
Limitations of memory system performance
 
Von Neumann Architecture
Von Neumann Architecture   Von Neumann Architecture
Von Neumann Architecture
 
COMPUTER ORGANIZATION NOTES Unit 5
COMPUTER ORGANIZATION NOTES Unit 5COMPUTER ORGANIZATION NOTES Unit 5
COMPUTER ORGANIZATION NOTES Unit 5
 
Demand paging
Demand pagingDemand paging
Demand paging
 
RAID
RAIDRAID
RAID
 
Evolution of os
Evolution of osEvolution of os
Evolution of os
 

Similar to Virtual memory

virtual memory
virtual memoryvirtual memory
virtual memory
Abeer Naskar
 
Os unit 2
Os unit 2Os unit 2
Os unit 2
Arnav Chowdhury
 
Memory Management
Memory ManagementMemory Management
Memory Management
sangrampatil81
 
Paging +Algorithem+Segmentation+memory management
Paging +Algorithem+Segmentation+memory managementPaging +Algorithem+Segmentation+memory management
Paging +Algorithem+Segmentation+memory management
kazim Hussain
 
CH09.pdf
CH09.pdfCH09.pdf
CH09.pdf
ImranKhan880955
 
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
Rai University
 
CSI-503 - 9. Virtual Memory
CSI-503 - 9. Virtual MemoryCSI-503 - 9. Virtual Memory
CSI-503 - 9. Virtual Memory
ghayour abbas
 
Abhaycavirtual memory and the pagehit.pptx
Abhaycavirtual memory and the pagehit.pptxAbhaycavirtual memory and the pagehit.pptx
Abhaycavirtual memory and the pagehit.pptx
wemoji5816
 
Operating system Memory management
Operating system Memory management Operating system Memory management
Operating system Memory management
Shashank Asthana
 
Virtual Memory
Virtual MemoryVirtual Memory
Virtual Memory
Archith777
 
Chap8 Virtual Memory. 1997-2003.ppt
Chap8 Virtual Memory. 1997-2003.pptChap8 Virtual Memory. 1997-2003.ppt
Chap8 Virtual Memory. 1997-2003.ppt
Muteebulhassan
 
Adobe Scan 06-Jan-2023.pdf demand paging document
Adobe Scan 06-Jan-2023.pdf demand paging documentAdobe Scan 06-Jan-2023.pdf demand paging document
Adobe Scan 06-Jan-2023.pdf demand paging document
AllyKhan2
 
VirutualMemory.docx
VirutualMemory.docxVirutualMemory.docx
VirutualMemory.docx
rangarajansoft69
 
Lecture20-21-22.ppt
Lecture20-21-22.pptLecture20-21-22.ppt
Lecture20-21-22.ppt
ssuserf67e3a
 
Ch9 OS
Ch9 OSCh9 OS
Ch9 OS
C.U
 
OS_Ch9
OS_Ch9OS_Ch9
OSCh9
OSCh9OSCh9
Unit 5Memory management.pptx
Unit 5Memory management.pptxUnit 5Memory management.pptx
Unit 5Memory management.pptx
SourabhRaj29
 
Unix Memory Management - Operating Systems
Unix Memory Management - Operating SystemsUnix Memory Management - Operating Systems
Unix Memory Management - Operating Systems
Drishti Bhalla
 
Virtual memory - Demand Paging
Virtual memory - Demand PagingVirtual memory - Demand Paging
Virtual memory - Demand Paging
jeyaperumal
 

Similar to Virtual memory (20)

virtual memory
virtual memoryvirtual memory
virtual memory
 
Os unit 2
Os unit 2Os unit 2
Os unit 2
 
Memory Management
Memory ManagementMemory Management
Memory Management
 
Paging +Algorithem+Segmentation+memory management
Paging +Algorithem+Segmentation+memory managementPaging +Algorithem+Segmentation+memory management
Paging +Algorithem+Segmentation+memory management
 
CH09.pdf
CH09.pdfCH09.pdf
CH09.pdf
 
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
 
Abhaycavirtual memory and the pagehit.pptx
Abhaycavirtual memory and the pagehit.pptxAbhaycavirtual memory and the pagehit.pptx
Abhaycavirtual memory and the pagehit.pptx
 
Operating system Memory management
Operating system Memory management Operating system Memory management
Operating system Memory management
 
Virtual Memory
Virtual MemoryVirtual Memory
Virtual Memory
 
Chap8 Virtual Memory. 1997-2003.ppt
Chap8 Virtual Memory. 1997-2003.pptChap8 Virtual Memory. 1997-2003.ppt
Chap8 Virtual Memory. 1997-2003.ppt
 
Adobe Scan 06-Jan-2023.pdf demand paging document
Adobe Scan 06-Jan-2023.pdf demand paging documentAdobe Scan 06-Jan-2023.pdf demand paging document
Adobe Scan 06-Jan-2023.pdf demand paging document
 
VirutualMemory.docx
VirutualMemory.docxVirutualMemory.docx
VirutualMemory.docx
 
Lecture20-21-22.ppt
Lecture20-21-22.pptLecture20-21-22.ppt
Lecture20-21-22.ppt
 
Ch9 OS
Ch9 OSCh9 OS
Ch9 OS
 
OS_Ch9
OS_Ch9OS_Ch9
OS_Ch9
 
OSCh9
OSCh9OSCh9
OSCh9
 
Unit 5Memory management.pptx
Unit 5Memory management.pptxUnit 5Memory management.pptx
Unit 5Memory management.pptx
 
Unix Memory Management - Operating Systems
Unix Memory Management - Operating SystemsUnix Memory Management - Operating Systems
Unix Memory Management - Operating Systems
 
Virtual memory - Demand Paging
Virtual memory - Demand PagingVirtual memory - Demand Paging
Virtual memory - Demand Paging
 

More from tamizh arthanari

Socio organizational issues ppt
Socio organizational issues pptSocio organizational issues ppt
Socio organizational issues ppt
tamizh arthanari
 
Unit iii ppt
Unit iii pptUnit iii ppt
Unit iii ppt
tamizh arthanari
 
Unit ii
Unit   iiUnit   ii
Unit ii design process
Unit ii design processUnit ii design process
Unit ii design process
tamizh arthanari
 
HCI Fundamentals - Part 2 : Human memory and thinking
HCI Fundamentals - Part 2 : Human memory and thinkingHCI Fundamentals - Part 2 : Human memory and thinking
HCI Fundamentals - Part 2 : Human memory and thinking
tamizh arthanari
 
Hci fundamentals
Hci fundamentalsHci fundamentals
Hci fundamentals
tamizh arthanari
 
Standard IO Interface
Standard IO InterfaceStandard IO Interface
Standard IO Interface
tamizh arthanari
 

More from tamizh arthanari (7)

Socio organizational issues ppt
Socio organizational issues pptSocio organizational issues ppt
Socio organizational issues ppt
 
Unit iii ppt
Unit iii pptUnit iii ppt
Unit iii ppt
 
Unit ii
Unit   iiUnit   ii
Unit ii
 
Unit ii design process
Unit ii design processUnit ii design process
Unit ii design process
 
HCI Fundamentals - Part 2 : Human memory and thinking
HCI Fundamentals - Part 2 : Human memory and thinkingHCI Fundamentals - Part 2 : Human memory and thinking
HCI Fundamentals - Part 2 : Human memory and thinking
 
Hci fundamentals
Hci fundamentalsHci fundamentals
Hci fundamentals
 
Standard IO Interface
Standard IO InterfaceStandard IO Interface
Standard IO Interface
 

Recently uploaded

DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODELDEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
gerogepatton
 
Manufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptxManufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptx
Madan Karki
 
Exception Handling notes in java exception
Exception Handling notes in java exceptionException Handling notes in java exception
Exception Handling notes in java exception
Ratnakar Mikkili
 
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
awadeshbabu
 
Series of visio cisco devices Cisco_Icons.ppt
Series of visio cisco devices Cisco_Icons.pptSeries of visio cisco devices Cisco_Icons.ppt
Series of visio cisco devices Cisco_Icons.ppt
PauloRodrigues104553
 
Iron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdf
Iron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdfIron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdf
Iron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdf
RadiNasr
 
Understanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine LearningUnderstanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine Learning
SUTEJAS
 
Wearable antenna for antenna applications
Wearable antenna for antenna applicationsWearable antenna for antenna applications
Wearable antenna for antenna applications
Madhumitha Jayaram
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
thanhdowork
 
Embedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoringEmbedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoring
IJECEIAES
 
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
Mukeshwaran Balu
 
A SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMS
A SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMSA SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMS
A SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMS
IJNSA Journal
 
CSM Cloud Service Management Presentarion
CSM Cloud Service Management PresentarionCSM Cloud Service Management Presentarion
CSM Cloud Service Management Presentarion
rpskprasana
 
22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt
KrishnaveniKrishnara1
 
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
IJECEIAES
 
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECTCHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
jpsjournal1
 
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressionsKuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
Victor Morales
 
2. Operations Strategy in a Global Environment.ppt
2. Operations Strategy in a Global Environment.ppt2. Operations Strategy in a Global Environment.ppt
2. Operations Strategy in a Global Environment.ppt
PuktoonEngr
 
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdfBPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
MIGUELANGEL966976
 
132/33KV substation case study Presentation
132/33KV substation case study Presentation132/33KV substation case study Presentation
132/33KV substation case study Presentation
kandramariana6
 

Recently uploaded (20)

DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODELDEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
 
Manufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptxManufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptx
 
Exception Handling notes in java exception
Exception Handling notes in java exceptionException Handling notes in java exception
Exception Handling notes in java exception
 
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
 
Series of visio cisco devices Cisco_Icons.ppt
Series of visio cisco devices Cisco_Icons.pptSeries of visio cisco devices Cisco_Icons.ppt
Series of visio cisco devices Cisco_Icons.ppt
 
Iron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdf
Iron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdfIron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdf
Iron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdf
 
Understanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine LearningUnderstanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine Learning
 
Wearable antenna for antenna applications
Wearable antenna for antenna applicationsWearable antenna for antenna applications
Wearable antenna for antenna applications
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
 
Embedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoringEmbedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoring
 
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
 
A SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMS
A SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMSA SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMS
A SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMS
 
CSM Cloud Service Management Presentarion
CSM Cloud Service Management PresentarionCSM Cloud Service Management Presentarion
CSM Cloud Service Management Presentarion
 
22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt
 
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
 
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECTCHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
 
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressionsKuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
 
2. Operations Strategy in a Global Environment.ppt
2. Operations Strategy in a Global Environment.ppt2. Operations Strategy in a Global Environment.ppt
2. Operations Strategy in a Global Environment.ppt
 
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdfBPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
 
132/33KV substation case study Presentation
132/33KV substation case study Presentation132/33KV substation case study Presentation
132/33KV substation case study Presentation
 

Virtual memory

  • 1. VIRTUAL MEMORY BY TAMIZHARASI A ASST PROFESSOR – CSE RMD ENGINEERING COLLEGE
  • 2. Virtual and Physical Memory �Physical Memory: memory actually available in the computer �Virtual Memory: memory that the OS allows a program to believe it has �Physical Address: real location in physical memory; identifies actual storage �Virtual Address: conventional addressing used by a program which the OS must translate into a physical address
  • 3. CPUCPU regsregs C a c h e MemoryMemory diskdisk size: speed: $/Mbyte: line size: 32 B 1 ns 8 B Register Cache Memory Disk Memory 32 KB-4MB 2 ns $125/MB 32 B 1024 MB 30 ns $0.20/MB 4 KB 100 GB 8 ms $0.001/MB larger, slower, cheaper 8 B 32 B 4 KB cache virtual memory
  • 4. if no enough space in main memory then secondary storage devices is used. the program is brought into the main memory while needed. the OS moves programs and data automatically between the main memory and secondary storage referred as virtual-memory techniques. the addresses that the processor issues for either instructions or data are called virtual or logical addresses.
  • 5.
  • 6. Memory management unit (MMU), translates virtual addresses into physical addresses. when the desired data (or instructions) are in the main memory, these data are fetched. if the data are not in the main memory, the MMU causes the operating system to bring the data into the memory from the disk. transfer of data between the disk and the main memory is performed using the DMA scheme.
  • 7. Processor Hardware Addr Trans Mechanism Main Memorya a' physical addressvirtual address part of the on-chip memory mgmt unit (MMU)
  • 8. ADDRESS TRANSLATION Pages:(basic unit of information) Virtual and physical address spaces divided into equal- sized blocks are called “pages” (both virtual and physical) occupies contiguous main memory locations ranges from 2K to 16K bytes in length. should not be too small, bcoz the access time of a magnetic disk is much longer than main memory. if too large it is possible that a substantial portion of a page may not be used.
  • 9. Cache techniques and virtual -memory techniques are very similar. Each virtual address has - virtual page number (high-order bits) - offset (low-order bits) specifies the location of a particular byte within a page. Page table:  has Information about the main memory location of each page like address where the page is stored and the current status of the page.
  • 10. An area in the main memory that can hold one page is called a page frame.  The starting address of the page table is kept in a page table base register.  By adding the virtual page number to the contents of this register, the address of the corresponding entry in the page table is obtained.
  • 11. Computing Physical Address Page Table Entry (PTE) provides information about page if (valid bit = 1) then the page is in memory. Use physical page number (PPN) to construct address if (valid bit = 0) then the page is on disk Page fault
  • 12. control bits that describe the status of the page one bit indicates the validity of the page, that is, whether the page is actually loaded in the main memory. Another bit indicates whether the page has been modified during its residency in the memory. Other control bits indicate various restrictions that may be imposed on accessing the page.
  • 13. Translation Lookaside Buffer (TLB):  due large size of page table it is impossible to include in MMU of processor. Hence, page table is kept in main memory. a copy of small portion of page can be a accommodated within MMU using TLB  A small cache consists of most recently accessed page entries  TLB must also include the virtual address of the entry.
  • 14.
  • 15. Address translation of TLB: If the page table entry is found in the TLB, the physical address is obtained immediately. else the required entry is obtained from the page table in the main memory and the TLB is updated. Page Fault: if the requested page is not in the main memory, a page fault is said to have occurred. The whole page must be brought from the disk into the memory before access can proceed. MMU asks the OS to intervene by raising an exception (interrupt).
  • 16. active task is interrupted, and OS then copies the requested page from the disk into the main memory and returns control to the interrupted task, a long delay may occur. when the task resumes, either the execution of the interrupted instruction must continue from the point of interruption or the instruction must be restarted. If a new page is brought from the disk when the main memory is full, it must replace one of the resident pages.  Least Recently Used is removed normally.  A control bit that is set to 1 whenever the corresponding page is referenced (accessed).
  • 17. The average translation time can be reduced by including one or more special registers that retain the virtual page number and the physical page frame of the most recently performed translations. MEMORY MANAGEMENT REQUIREMENTS  system space - OS routines  user space -user application programs reside.
  • 18. MMU uses a page table base register to determine the address of the table to be used in the translation process. by changing the contents of this regis-ter, OS can switch from one space to another. The physical main mem-ory is thus shared by the active pages of the system space and several user spaces.  can access only the pages that belong to one of these spaces at any given time.
  • 19. No program should be allowed to destroy either the data or instructions of other programs in the memory. The processor has two states: Supervisor state The processor is usually placed in the supervisor state when OS routines are being executed and in the user state to execute user programs. User State In the user state, some machine instructions cannot be executed.
  • 20. These privileged instructions, which include such operations as modifying the page table base register, can only be executed while the processor is in the supervisor state. Hence, a user program is prevented from accessing the page tables of other user spaces or of the system space. some application program have access to certain pages belonging to another program.
  • 21. OS can arrange this by causing these pages to appear in both spaces. The shared pages will therefore have entries in two different page tables. The control bits in each table entry can be sent to control the access privileges granted to each program.