Patent ID: 7421533

Claim:
A method for managing virtual memory in a virtualization platform, comprising: launching at least one guest operating system (OS) in a virtual machine (VM), wherein memory used by the VM is virtual memory assigned and managed by a virtual machine monitor (VMM) in a 2-stage memory abstraction, wherein it appears to the at least one guest OS that assigned memory begins at address zero, and wherein the VMM maps a virtual memory address to a physical memory address in the assigned memory; the VMM creating a virtual range of memory larger than an amount of physical memory in the platform, wherein when a VM attempts access to a region of memory where there is not a physical backing page of memory, the VMM using a non-volatile memory store to provide an area to page memory to/from the VM; determining, by the VMM, if a first VM requires a change in memory allocation; and if the first VM requires additional allocated memory, then the VMM allocating pages of memory to the first VM, the allocated pages comprising unused or reclaimed pages of memory, but if the first VM has excess memory, then reclaiming pages of memory from the first VM, by the VMM, and storing the reclaimed pages in the non-volatile memory store for later use by the VM, wherein memory allocation is performed dynamically at runtime, wherein reclaiming pages of memory further comprises: determining whether the memory of a VM includes at least one of unused memory and infrequently used memory, and reclaiming the memory determined to be unused or infrequently used; wherein selected memory required by a guest OS in a VM is pinned by the VMM based on a processor context switch indicating a direct memory access (DMA) attempt by the VM, and wherein pinning of memory results in the memory being prohibited from being reallocated, reclaimed or page swapped.