Summary
- In the earliest days, either a process fit a memory or it could not be run.
- Virtual memory changed the status quo by allowing a process that cannot fit in physical memory to run as if it essentially fits the memory.
- An indirect inference of virtual memory is that multiple processes that cannot collectively fit a certain physical memory can now run together on this same physical memory.
- The basic idea of virtual memory is that each process is provided with its own virtual address space.
- The virtual address space of each process is translated to the physical address space that is used to actually access the physical memory.
- The translation of virtual addresses to physical addresses is maintained in a per-process software data structure called the page table.
- In traditional systems (i.e., nonvirtualized environments), the virtual-to-physical translation is called one-level page mapping.
- In virtualized environments (i.e., when a hypervisor is involved), the virtual-to-physical translation is extended at least one more level and called two-level page mapping.
- The two-level page mapping entails two consecutive translations, virtual-to-real and then real-to-physical translations. In this case, the real address space refers to the memory space of a VM, while the virtual and physical address spaces relate to the traditional memory spaces of processes and the physical memory.
- As a result, memory virtualization in virtualized environments typically is perceived as an extension to the classic virtual memory concept supported in most general-purpose OSs.
- When the combined total size of real memories grows beyond the actual size of the underlying physical memory, memory overcommitment is attained.
- Memory overcommitment improves memory utilization via allowing VMs with aggregate real memories larger than the physical memory to run simultaneously.
- Memory overcommitment, however, necessitates reclaiming inactive real memory pages at VMs and relocating them to the hypervisor when experiencing a physical memory shortage. This is called reclamation technique.
- One of the popular reclamation techniques is the ballooning process incorporated in VMware ESXi.