Storage Management

• Virtual Memory




                                    1
HOME     PREVIOUS TOPIC NEXT
PREVIOUS QUESTION PAPERS FOR OS
CPP TUTORIALS




            9CM402.39             2
Recap


In the last class, you have learnt:

• Paged Segmentation

• MULTICS Address Translation Scheme




                                       3
Objective


 On completion of this class, you will be able to
 know
• Virtual Memory Techniques




                                                    4
Virtual Memory Techniques

• RAM is expensive ( but fast ), disk is cheap (but
  slow)
• Need to find a way to use the cheaper memory
  – Store memory that isn’t frequently used on disk

  – Swap pages between disk and memory as needed

• Treat main memory as a cache for pages on
  disk

                                                      5
Virtual Memory

• It is 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
                                                         6
Virtual Memory


• Virtual memory can be implemented via:

  – Demand paging

  – Demand segmentation




                                           7
Virtual Memory
• It is a conceptual separation of user logical memory from
  physical memory
• Thus we can have large virtual memory on a small physical
  memory
Individual Pages




                             Physical             Disk
       Virtual     Memory
       Memory       Map      Memory
                                                         8
Virtual Memory

• Programs can be larger than memory

  – Program loaded into memory as needed

  – Active program and data “swapped” to a disk until

    needed

• Memory space treated uniformly



                                                        9
WHY VIRTUAL MEMORY?

  • Previously entire logical space was required for the

    process to be in memory
  • Before the process could run

  • The alternatives to this

  • Most code / data isn't needed at any instant, or even

    within a finite time
  • We can bring it in only as needed



                                                      10
Virtual Memory
Advantages

• Gives a higher level of multiprogramming


• The program size isn't constrained (thus the

 term 'virtual memory'). Virtual memory allows

 very large logical address spaces

• Swap sizes smaller
                                             11
Summary


 In this class, you have learnt

• Virtual Memory




                                  12
Frequently Asked Questions

• Explain Virtual Memory concepts with a neat

  sketch




                                                13
Quiz
1. __________separation of user logical memory
 from physical memory
 a) Segmentation
 b) Virtual memory
 c) None

2. ____________gives a higher level of
 multiprogramming
  a) Page offset
  b) Hole
   c) Virtual memory
   d) None                                       14
Quiz
3. Logical address space can be much larger than
   a) Page number
   b) MULTICS
   c) Physical address space
   d) None

4. __________allows very large logical address
   spaces
    a) External fragmentation
    b) Virtual memory
    c) Compaction
    d) None                                        15
Other subject materials

•   Web designing
•   Micro processors
•   C++ tutorials
•   java

home

39 virtual memory

  • 1.
  • 2.
    HOME PREVIOUS TOPIC NEXT PREVIOUS QUESTION PAPERS FOR OS CPP TUTORIALS 9CM402.39 2
  • 3.
    Recap In the lastclass, you have learnt: • Paged Segmentation • MULTICS Address Translation Scheme 3
  • 4.
    Objective On completionof this class, you will be able to know • Virtual Memory Techniques 4
  • 5.
    Virtual Memory Techniques •RAM is expensive ( but fast ), disk is cheap (but slow) • Need to find a way to use the cheaper memory – Store memory that isn’t frequently used on disk – Swap pages between disk and memory as needed • Treat main memory as a cache for pages on disk 5
  • 6.
    Virtual Memory • Itis 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 6
  • 7.
    Virtual Memory • Virtualmemory can be implemented via: – Demand paging – Demand segmentation 7
  • 8.
    Virtual Memory • Itis a conceptual separation of user logical memory from physical memory • Thus we can have large virtual memory on a small physical memory Individual Pages Physical Disk Virtual Memory Memory Map Memory 8
  • 9.
    Virtual Memory • Programscan be larger than memory – Program loaded into memory as needed – Active program and data “swapped” to a disk until needed • Memory space treated uniformly 9
  • 10.
    WHY VIRTUAL MEMORY? • Previously entire logical space was required for the process to be in memory • Before the process could run • The alternatives to this • Most code / data isn't needed at any instant, or even within a finite time • We can bring it in only as needed 10
  • 11.
    Virtual Memory Advantages • Givesa higher level of multiprogramming • The program size isn't constrained (thus the term 'virtual memory'). Virtual memory allows very large logical address spaces • Swap sizes smaller 11
  • 12.
    Summary In thisclass, you have learnt • Virtual Memory 12
  • 13.
    Frequently Asked Questions •Explain Virtual Memory concepts with a neat sketch 13
  • 14.
    Quiz 1. __________separation ofuser logical memory from physical memory a) Segmentation b) Virtual memory c) None 2. ____________gives a higher level of multiprogramming a) Page offset b) Hole c) Virtual memory d) None 14
  • 15.
    Quiz 3. Logical addressspace can be much larger than a) Page number b) MULTICS c) Physical address space d) None 4. __________allows very large logical address spaces a) External fragmentation b) Virtual memory c) Compaction d) None 15
  • 16.
    Other subject materials • Web designing • Micro processors • C++ tutorials • java home