SlideShare a Scribd company logo
1 of 10
Operating System 36
Virtual Memory
Prof Neeraj Bhargava
Vaibhav Khanna
Department of Computer Science
School of Engineering and Systems Sciences
Maharshi Dayanand Saraswati University Ajmer
Virtual Memory
• Code needs to be in memory to execute, but entire
program rarely used
– Error code, unusual routines, large data structures
• Entire program code not needed at same time
• Consider ability to execute partially-loaded
program
– Program no longer constrained by limits of physical
memory
– Each program takes less memory while running ->
more programs run at the same time
• Increased CPU utilization and throughput with no increase
in response time or turnaround time
– Less I/O needed to load or swap programs into
memory -> each user program runs faster
Virtual Memory
• Virtual memory is a technique that permits the
execution of processes that may not be completely
resident in the memory.
• The main advantage of this scheme is that programs
can be larger than physical memory.
• Further, it views main memory into an extremely large,
uniform array of storage, separating logical memory as
viewed by the user from physical memory.
• It, as a matter of fact augments the main memory with
secondary storage devices (like hard disks).
• This technique frees programmers from concern over
memory storage limitations.
Background (Cont.)
• 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
– More programs running concurrently
– Less I/O needed to load or swap processes
Background (Cont.)
• Virtual address space – logical view of
how process is stored in memory
– Usually start at address 0, contiguous addresses
until end of space
– Meanwhile, physical memory organized in page
frames
– MMU must map logical to physical
• Virtual memory can be implemented
via:
– Demand paging
– Demand segmentation
Virtual Memory That is Larger Than Physical Memory
Virtual-address Space
 Usually design logical address space for
stack to start at Max logical address and
grow “down” while heap grows “up”
 Maximizes address space use
 Unused address space between
the two is hole
 No physical memory needed
until heap or stack grows to a
given new page
 Enables sparse address spaces with
holes left for growth, dynamically linked
libraries, etc
 System libraries shared via mapping into
virtual address space
 Shared memory by mapping pages read-
write into virtual address space
 Pages can be shared during fork(),
speeding process creation
Shared Library Using Virtual
Memory
Implementation
• Virtual memory makes the task of programming much easier,
because the programmer no longer needs to worry about the
amount of physical memory available, or about what code can be
placed in overlays, but can concentrate instead on the problem to
be programmed.
• On systems, which support virtual memory, overlays have virtually
disappeared, therefore.
• Virtual memory is commonly implemented by Demand Paging.
• It can also be implemented in a segmentation system.
• Several systems provide a paged segmentation scheme, where
segments are broken into pages.
• Thus, the user view is segmentation, but the operating system can
implement this view with demand paging.
Assignment
• Explain the concept and usage of virtual
Memory

More Related Content

Similar to Operating system 36 virtual memory

Chapter 9 OS
Chapter 9 OSChapter 9 OS
Chapter 9 OS
C.U
 
Chapter 2 part 1
Chapter 2 part 1Chapter 2 part 1
Chapter 2 part 1
rohassanie
 
MEMORY MANAGEMENT FHES har ar mahaadev.pptx
MEMORY MANAGEMENT FHES har ar mahaadev.pptxMEMORY MANAGEMENT FHES har ar mahaadev.pptx
MEMORY MANAGEMENT FHES har ar mahaadev.pptx
22bec032
 

Similar to Operating system 36 virtual memory (20)

Chapter 9 OS
Chapter 9 OSChapter 9 OS
Chapter 9 OS
 
Power Point Presentation on Virtual Memory.ppt
Power Point Presentation on Virtual Memory.pptPower Point Presentation on Virtual Memory.ppt
Power Point Presentation on Virtual Memory.ppt
 
07-MemoryManagement.ppt
07-MemoryManagement.ppt07-MemoryManagement.ppt
07-MemoryManagement.ppt
 
Operating system memory management
Operating system memory managementOperating system memory management
Operating system memory management
 
CS6401 OPERATING SYSTEMS Unit 3
CS6401 OPERATING SYSTEMS Unit 3CS6401 OPERATING SYSTEMS Unit 3
CS6401 OPERATING SYSTEMS Unit 3
 
OS Presentation 2023.pptx
OS Presentation 2023.pptxOS Presentation 2023.pptx
OS Presentation 2023.pptx
 
Unit iiios Storage Management
Unit iiios Storage ManagementUnit iiios Storage Management
Unit iiios Storage Management
 
Chapter 2 part 1
Chapter 2 part 1Chapter 2 part 1
Chapter 2 part 1
 
Virtual Memory Management Part - I.pdf
Virtual Memory Management Part - I.pdfVirtual Memory Management Part - I.pdf
Virtual Memory Management Part - I.pdf
 
Paging +Algorithem+Segmentation+memory management
Paging +Algorithem+Segmentation+memory managementPaging +Algorithem+Segmentation+memory management
Paging +Algorithem+Segmentation+memory management
 
Chapter07_ds.ppt
Chapter07_ds.pptChapter07_ds.ppt
Chapter07_ds.ppt
 
CSE2010- Module 4 V1.pptx
CSE2010- Module 4 V1.pptxCSE2010- Module 4 V1.pptx
CSE2010- Module 4 V1.pptx
 
Ch8 main memory
Ch8   main memoryCh8   main memory
Ch8 main memory
 
Cs8493 unit 3
Cs8493 unit 3Cs8493 unit 3
Cs8493 unit 3
 
UNIT 3-EXPLAINING THE MEMORY MANAGEMENT LOGICAL AND AND PHYSICAL DATA FLOW DI...
UNIT 3-EXPLAINING THE MEMORY MANAGEMENT LOGICAL AND AND PHYSICAL DATA FLOW DI...UNIT 3-EXPLAINING THE MEMORY MANAGEMENT LOGICAL AND AND PHYSICAL DATA FLOW DI...
UNIT 3-EXPLAINING THE MEMORY MANAGEMENT LOGICAL AND AND PHYSICAL DATA FLOW DI...
 
Memory Management.pdf
Memory Management.pdfMemory Management.pdf
Memory Management.pdf
 
MEMORY MANAGEMENT FHES har ar mahaadev.pptx
MEMORY MANAGEMENT FHES har ar mahaadev.pptxMEMORY MANAGEMENT FHES har ar mahaadev.pptx
MEMORY MANAGEMENT FHES har ar mahaadev.pptx
 
CH08.pdf
CH08.pdfCH08.pdf
CH08.pdf
 
Virtual memory
Virtual memoryVirtual memory
Virtual memory
 
Cs8493 unit 3
Cs8493 unit 3Cs8493 unit 3
Cs8493 unit 3
 

More from Vaibhav Khanna

More from Vaibhav Khanna (20)

Information and network security 47 authentication applications
Information and network security 47 authentication applicationsInformation and network security 47 authentication applications
Information and network security 47 authentication applications
 
Information and network security 46 digital signature algorithm
Information and network security 46 digital signature algorithmInformation and network security 46 digital signature algorithm
Information and network security 46 digital signature algorithm
 
Information and network security 45 digital signature standard
Information and network security 45 digital signature standardInformation and network security 45 digital signature standard
Information and network security 45 digital signature standard
 
Information and network security 44 direct digital signatures
Information and network security 44 direct digital signaturesInformation and network security 44 direct digital signatures
Information and network security 44 direct digital signatures
 
Information and network security 43 digital signatures
Information and network security 43 digital signaturesInformation and network security 43 digital signatures
Information and network security 43 digital signatures
 
Information and network security 42 security of message authentication code
Information and network security 42 security of message authentication codeInformation and network security 42 security of message authentication code
Information and network security 42 security of message authentication code
 
Information and network security 41 message authentication code
Information and network security 41 message authentication codeInformation and network security 41 message authentication code
Information and network security 41 message authentication code
 
Information and network security 40 sha3 secure hash algorithm
Information and network security 40 sha3 secure hash algorithmInformation and network security 40 sha3 secure hash algorithm
Information and network security 40 sha3 secure hash algorithm
 
Information and network security 39 secure hash algorithm
Information and network security 39 secure hash algorithmInformation and network security 39 secure hash algorithm
Information and network security 39 secure hash algorithm
 
Information and network security 38 birthday attacks and security of hash fun...
Information and network security 38 birthday attacks and security of hash fun...Information and network security 38 birthday attacks and security of hash fun...
Information and network security 38 birthday attacks and security of hash fun...
 
Information and network security 37 hash functions and message authentication
Information and network security 37 hash functions and message authenticationInformation and network security 37 hash functions and message authentication
Information and network security 37 hash functions and message authentication
 
Information and network security 35 the chinese remainder theorem
Information and network security 35 the chinese remainder theoremInformation and network security 35 the chinese remainder theorem
Information and network security 35 the chinese remainder theorem
 
Information and network security 34 primality
Information and network security 34 primalityInformation and network security 34 primality
Information and network security 34 primality
 
Information and network security 33 rsa algorithm
Information and network security 33 rsa algorithmInformation and network security 33 rsa algorithm
Information and network security 33 rsa algorithm
 
Information and network security 32 principles of public key cryptosystems
Information and network security 32 principles of public key cryptosystemsInformation and network security 32 principles of public key cryptosystems
Information and network security 32 principles of public key cryptosystems
 
Information and network security 31 public key cryptography
Information and network security 31 public key cryptographyInformation and network security 31 public key cryptography
Information and network security 31 public key cryptography
 
Information and network security 30 random numbers
Information and network security 30 random numbersInformation and network security 30 random numbers
Information and network security 30 random numbers
 
Information and network security 29 international data encryption algorithm
Information and network security 29 international data encryption algorithmInformation and network security 29 international data encryption algorithm
Information and network security 29 international data encryption algorithm
 
Information and network security 28 blowfish
Information and network security 28 blowfishInformation and network security 28 blowfish
Information and network security 28 blowfish
 
Information and network security 27 triple des
Information and network security 27 triple desInformation and network security 27 triple des
Information and network security 27 triple des
 

Recently uploaded

%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
masabamasaba
 
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
chiefasafspells
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
masabamasaba
 
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
masabamasaba
 

Recently uploaded (20)

Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
 
WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...
WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...
WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...
 
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
 
WSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security Program
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
WSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - KeynoteWSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - Keynote
 
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
 
WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...
WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...
WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...
 
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
 
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open SourceWSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 

Operating system 36 virtual memory

  • 1. Operating System 36 Virtual Memory Prof Neeraj Bhargava Vaibhav Khanna Department of Computer Science School of Engineering and Systems Sciences Maharshi Dayanand Saraswati University Ajmer
  • 2. Virtual Memory • Code needs to be in memory to execute, but entire program rarely used – Error code, unusual routines, large data structures • Entire program code not needed at same time • Consider ability to execute partially-loaded program – Program no longer constrained by limits of physical memory – Each program takes less memory while running -> more programs run at the same time • Increased CPU utilization and throughput with no increase in response time or turnaround time – Less I/O needed to load or swap programs into memory -> each user program runs faster
  • 3. Virtual Memory • Virtual memory is a technique that permits the execution of processes that may not be completely resident in the memory. • The main advantage of this scheme is that programs can be larger than physical memory. • Further, it views main memory into an extremely large, uniform array of storage, separating logical memory as viewed by the user from physical memory. • It, as a matter of fact augments the main memory with secondary storage devices (like hard disks). • This technique frees programmers from concern over memory storage limitations.
  • 4. Background (Cont.) • 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 – More programs running concurrently – Less I/O needed to load or swap processes
  • 5. Background (Cont.) • Virtual address space – logical view of how process is stored in memory – Usually start at address 0, contiguous addresses until end of space – Meanwhile, physical memory organized in page frames – MMU must map logical to physical • Virtual memory can be implemented via: – Demand paging – Demand segmentation
  • 6. Virtual Memory That is Larger Than Physical Memory
  • 7. Virtual-address Space  Usually design logical address space for stack to start at Max logical address and grow “down” while heap grows “up”  Maximizes address space use  Unused address space between the two is hole  No physical memory needed until heap or stack grows to a given new page  Enables sparse address spaces with holes left for growth, dynamically linked libraries, etc  System libraries shared via mapping into virtual address space  Shared memory by mapping pages read- write into virtual address space  Pages can be shared during fork(), speeding process creation
  • 8. Shared Library Using Virtual Memory
  • 9. Implementation • Virtual memory makes the task of programming much easier, because the programmer no longer needs to worry about the amount of physical memory available, or about what code can be placed in overlays, but can concentrate instead on the problem to be programmed. • On systems, which support virtual memory, overlays have virtually disappeared, therefore. • Virtual memory is commonly implemented by Demand Paging. • It can also be implemented in a segmentation system. • Several systems provide a paged segmentation scheme, where segments are broken into pages. • Thus, the user view is segmentation, but the operating system can implement this view with demand paging.
  • 10. Assignment • Explain the concept and usage of virtual Memory