Virtual Memory

  • An abstraction that provides each process with the illusion that it has exclusive use of main memory.
  • Each process has the same uniform view of memory, known as its virtual address space.
  • Virtual address space consists of:
    • Program code and data: static and contains code and global vars.
    • Heap: dynamically allocated at run time.
    • Shared libraries: e.g. C Standard Lib.
    • Stack: dynamically allocated at run time.
    • Kernel virtual memory: apps are not allowed to read/write the contents of this area of directly call functions defined in the kernel code.
  • Requires sophisticated interaction between the hardware and OS software to work.
    • Includes a hardware translation of every address generated by the processor.
    • Basic idea: store content of process' virtual memory on disk and then use main memory as a cache for the disk.