SlideShare a Scribd company logo
Virtual Memory




                 - Ishwar Dhumal
Virtual Memory

       In a computer system, virtual memory is something that
  appears to be exist, but actually does not exist. Virtual memory is a
  technique , which allows execution of the process , that are not
  completely present in the memory.

Advantages:
1] The program can be larger than physical memory.
2] This frees programmers from the concerns of memory limitations.
3] Virtual memory provides efficient mechanism for discontinuous
  memory allocation.
Virtual Memory
      The basic idea behind virtual memory is that the combined size of the program
code , data , stack may exceed the amount of physical memory available for it . The
OS keeps only those parts of the program which are currently needed by the CPU in
main memory , and rest on the disk.


For e.g.-
      A 16 MB program can run in 4 MB space by carefully choosing which 4 MB
to keep in memory at each instance , with pieces of the program being swapped
between disk and memory as needed.


       Virtual memory concept can also work in multiprogramming system , with
pieces of many programs in memory at a time. And while one process is swapping
its pieces(pages) the CPU can be given to another process.
The fundamental approach used in implementing virtual memory
system is demand paging.

Demand Paging :

         Consider the situation that an executable program is to be loaded
from the disk into memory. Now , one option for this is to load the entire
program in memory at a time . Now , the problem with this approach is
that we may not have the sufficient memory to load the full program OR
if memory is available still initially we do not need the entire program in
the memory.
         Consider a program that starts with a list of available options
from which user has to select one option . So , loading the entire program
results in loading the executable code for all options , regardless of user
selection. So , this approach is wasting system time and memory space.
Demand Paging :
      So, an alternative strategy is used i.e. only those pages which
      are initially required for the execution are loaded . This
      technique is called as Demand Paging . So, in demand paging
      pages are only loaded when they are demanded during
      program execution .Pages that are never accessed are thus
      never loaded into memory.
            Main Memory

                                                      Disk


Program
                              Swap Out
   A

                              Swap In
Demand Paging
  A Demand paging system is similar to a paging system with
  swapping. When we want to execute a process, we swap it
  into memory. Rather than swapping the entire process into
  memory, however, we use a swapper. This swapper never
  swaps a page into memory unless it is demanded by the
  process. Such a swapper is called lazy swapper and such
  demand paging is called Pure demand paging.

Conclusion:
  The virtual memory is nothing but the space provided on
  secondary memory to store the parts of processes which is
  accessed just as if it is the main memory.

More Related Content

PPTX
Views
PDF
Object Oriented Programming Using C++ Practical File
PPTX
Presentation on "Knowledge acquisition & validation"
PDF
ASP.NET- database connectivity
DOC
Dbms Lecture Notes
PDF
database management system lab files
PDF
Data Modeling Using the EntityRelationship (ER) Model
PPTX
Dynamic Polymorphism in C++
Views
Object Oriented Programming Using C++ Practical File
Presentation on "Knowledge acquisition & validation"
ASP.NET- database connectivity
Dbms Lecture Notes
database management system lab files
Data Modeling Using the EntityRelationship (ER) Model
Dynamic Polymorphism in C++

What's hot (8)

PPTX
SQL Join Basic
PPTX
Adjustment of inheritance
PPTX
knowledge representation using rules
DOCX
Database development life cycle
PDF
Gogu nina uaic_iasi_2007
PPTX
Symbolic-Reasoning-Under-Uncertainty.pptx
PPTX
File Organization
SQL Join Basic
Adjustment of inheritance
knowledge representation using rules
Database development life cycle
Gogu nina uaic_iasi_2007
Symbolic-Reasoning-Under-Uncertainty.pptx
File Organization
Ad

Similar to Virtual memory (20)

PPTX
virtual memory
PPTX
os memory management unit iii memory.pptx
PDF
Virtual memory
PPTX
Os unit 2
PPT
Unit 5 Memory management System in OS.ppt
PPTX
Unit 5 Memory management in OS Unit 5 Memory management in OS
DOCX
Memory management
PDF
CSI-503 - 9. Virtual Memory
PPTX
Presentation on Virtual Memory concepts in computer
PPT
Virtual Memory
PDF
Virtual+Cache_Memory Operation System...
PPT
virtual memory.ppt
DOCX
Virtual memory
PPT
Chapter 09 - Virtual Memory.ppt
PDF
CSI-503 - 6. Memory Management
PPT
NOV11 virtual memory.ppt
PPTX
unit5_os (1).pptx
PPTX
OS Presentation 2023.pptx
PPT
NOV11 virtual memory.ppt
virtual memory
os memory management unit iii memory.pptx
Virtual memory
Os unit 2
Unit 5 Memory management System in OS.ppt
Unit 5 Memory management in OS Unit 5 Memory management in OS
Memory management
CSI-503 - 9. Virtual Memory
Presentation on Virtual Memory concepts in computer
Virtual Memory
Virtual+Cache_Memory Operation System...
virtual memory.ppt
Virtual memory
Chapter 09 - Virtual Memory.ppt
CSI-503 - 6. Memory Management
NOV11 virtual memory.ppt
unit5_os (1).pptx
OS Presentation 2023.pptx
NOV11 virtual memory.ppt
Ad

Recently uploaded (20)

PDF
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
PDF
A systematic review of self-coping strategies used by university students to ...
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
Paper A Mock Exam 9_ Attempt review.pdf.
PDF
LDMMIA Reiki Yoga Finals Review Spring Summer
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PDF
medical_surgical_nursing_10th_edition_ignatavicius_TEST_BANK_pdf.pdf
PPTX
UNIT III MENTAL HEALTH NURSING ASSESSMENT
PDF
SOIL: Factor, Horizon, Process, Classification, Degradation, Conservation
PPTX
Radiologic_Anatomy_of_the_Brachial_plexus [final].pptx
PDF
RTP_AR_KS1_Tutor's Guide_English [FOR REPRODUCTION].pdf
PDF
ChatGPT for Dummies - Pam Baker Ccesa007.pdf
PPTX
Orientation - ARALprogram of Deped to the Parents.pptx
PPTX
Introduction to Building Materials
PDF
1_English_Language_Set_2.pdf probationary
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PDF
Weekly quiz Compilation Jan -July 25.pdf
PDF
Practical Manual AGRO-233 Principles and Practices of Natural Farming
PDF
Indian roads congress 037 - 2012 Flexible pavement
PDF
RMMM.pdf make it easy to upload and study
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
A systematic review of self-coping strategies used by university students to ...
Final Presentation General Medicine 03-08-2024.pptx
Paper A Mock Exam 9_ Attempt review.pdf.
LDMMIA Reiki Yoga Finals Review Spring Summer
Supply Chain Operations Speaking Notes -ICLT Program
medical_surgical_nursing_10th_edition_ignatavicius_TEST_BANK_pdf.pdf
UNIT III MENTAL HEALTH NURSING ASSESSMENT
SOIL: Factor, Horizon, Process, Classification, Degradation, Conservation
Radiologic_Anatomy_of_the_Brachial_plexus [final].pptx
RTP_AR_KS1_Tutor's Guide_English [FOR REPRODUCTION].pdf
ChatGPT for Dummies - Pam Baker Ccesa007.pdf
Orientation - ARALprogram of Deped to the Parents.pptx
Introduction to Building Materials
1_English_Language_Set_2.pdf probationary
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
Weekly quiz Compilation Jan -July 25.pdf
Practical Manual AGRO-233 Principles and Practices of Natural Farming
Indian roads congress 037 - 2012 Flexible pavement
RMMM.pdf make it easy to upload and study

Virtual memory

  • 1. Virtual Memory - Ishwar Dhumal
  • 2. Virtual Memory In a computer system, virtual memory is something that appears to be exist, but actually does not exist. Virtual memory is a technique , which allows execution of the process , that are not completely present in the memory. Advantages: 1] The program can be larger than physical memory. 2] This frees programmers from the concerns of memory limitations. 3] Virtual memory provides efficient mechanism for discontinuous memory allocation.
  • 3. Virtual Memory The basic idea behind virtual memory is that the combined size of the program code , data , stack may exceed the amount of physical memory available for it . The OS keeps only those parts of the program which are currently needed by the CPU in main memory , and rest on the disk. For e.g.- A 16 MB program can run in 4 MB space by carefully choosing which 4 MB to keep in memory at each instance , with pieces of the program being swapped between disk and memory as needed. Virtual memory concept can also work in multiprogramming system , with pieces of many programs in memory at a time. And while one process is swapping its pieces(pages) the CPU can be given to another process.
  • 4. The fundamental approach used in implementing virtual memory system is demand paging. Demand Paging : Consider the situation that an executable program is to be loaded from the disk into memory. Now , one option for this is to load the entire program in memory at a time . Now , the problem with this approach is that we may not have the sufficient memory to load the full program OR if memory is available still initially we do not need the entire program in the memory. Consider a program that starts with a list of available options from which user has to select one option . So , loading the entire program results in loading the executable code for all options , regardless of user selection. So , this approach is wasting system time and memory space.
  • 5. Demand Paging : So, an alternative strategy is used i.e. only those pages which are initially required for the execution are loaded . This technique is called as Demand Paging . So, in demand paging pages are only loaded when they are demanded during program execution .Pages that are never accessed are thus never loaded into memory. Main Memory Disk Program Swap Out A Swap In
  • 6. Demand Paging A Demand paging system is similar to a paging system with swapping. When we want to execute a process, we swap it into memory. Rather than swapping the entire process into memory, however, we use a swapper. This swapper never swaps a page into memory unless it is demanded by the process. Such a swapper is called lazy swapper and such demand paging is called Pure demand paging. Conclusion: The virtual memory is nothing but the space provided on secondary memory to store the parts of processes which is accessed just as if it is the main memory.