Module 2: Virtual Memory and Caches
  Lecture 3: Virtual Memory and Caches
 


RECAP: VIRTUAL MEMORY AND CACHE

Why Virtual Memory?

  • With a 32-bit address you can access 4 GB of physical memory (you will never get the full memory though)
    • Seems enough for most day-to-day applications
    • But there are important applications that have much bigger memory footprint: databases, scientific apps operating on large matrices etc.
    • Even if your application fits entirely in physical memory it seems unfair to load the full image at startup
    • Just takes away memory from other processes, but probably doesn't need the full image at any point of time during Execution: hurts multiprogramming
  • Need to provide an illusion of bigger memory: Virtual Memory (VM)

Virtual Memory

  • Need an address to access virtual memory
    • Virtual Address (VA)
  • Assume a 32-bit VA
    • Every process sees a 4 GB of virtual memory
    • This is much better than a 4 GB physical memory shared between multiprogrammed processes
    • The size of VA is really fixed by the processor data path width
    • 64-bit processors (Alpha 21264, 21364; Sun UltraSPARC ; AMD Athlon64, Opteron ; IBM POWER4, POWER5; MIPS R10000 onwards; Intel Itanium etc., and recently Intel Pentium4) provide bigger virtual memory to each process
    • Large virtual and physical memory is very important in commercial server market: need to run large databases