Resource Management Guide : Resource Management Concepts : Understanding CPU and Memory Virtualization : Memory Virtualization Basics

Memory Virtualization Basics
The VMkernel manages all machine memory. (An exception to this is the memory that is allocated to the service console in ESX Server 3.) The VMkernel dedicates part of this managed machine memory for its own use. The rest is available for use by virtual machines. Virtual machines use machine memory for two purposes: each virtual machine requires its own memory and the VMM requires some memory for its code and data.
To view information on how a host’s memory is being used
1
2
Click the Configuration tab.
3
Select Memory.
You can view the information about the total memory and memory available to virtual machines. In ESX Server 3, you can also view memory assigned to the service console.
Virtual Machine Memory
Each virtual machine consumes memory based on its configured size, plus additional overhead memory for virtualization.
Configured Size.
The configured size is a construct maintained by the virtualization layer for the virtual machine. It is the amount of memory that is presented to the guest operating system, but it is independent of the amount of physical RAM that is allocated to the virtual machine, which depends on the resource settings (shares, reservation, limit) explained below.
For example, consider a virtual machine with a configured size of 1GB. When the guest operating system boots, it believes that it is running on a dedicated machine with 1GB of physical memory. The actual amount of physical host memory allocated to the virtual machine depends on its memory resource settings and memory contention on the ESX Server host. In some cases, the virtual machine might be allocated the full 1GB. In other cases, it might receive a smaller allocation. Regardless of the actual allocation, the guest operating system continues to behave as though it is running on a dedicated machine with 1GB of physical memory.
Shares.
Specify the relative priority for a virtual machine if more than the reservation is available. See Shares.
Reservation.
Is a guaranteed lower bound on the amount of physical memory that the host reserves for the virtual machine, even when memory is overcommitted. Set the reservation to a level that ensures the virtual machine has sufficient memory to run efficiently, without excessive paging.
Limit.
Is an upper bound on the amount of physical memory that the host will allocate to the virtual machine. The virtual machine’s memory allocation is also implicitly limited by its configured size.
Overhead memory includes space reserved for the virtual machine frame buffer and various virtualization data structures. See Understanding Memory Overhead.
Memory Overcommitment
For each running virtual machine, the system reserves physical memory for the virtual machine’s reservation (if any) and for its virtualization overhead. Because of the memory management techniques the ESX Server host uses, your virtual machines can use more memory than the physical machine (the host) has available. For example, you can have a host with 2GB memory and run four virtual machines with 1GB memory each. In that case, the memory is overcommitted.
Overcommitment makes sense because, typically, some virtual machines are lightly loaded while others are more heavily loaded, and relative activity levels vary over time.
To improve memory utilization, the ESX Server host transfers memory from idle virtual machines to virtual machines that need more memory. Use the Reservation or Shares parameter to preferentially allocate memory to important virtual machines. This memory remains available to other virtual machines if it is not in use.
Memory Sharing
Many workloads present opportunities for sharing memory across virtual machines. For example, several virtual machines might be running instances of the same guest operating system, have the same applications or components loaded, or contain common data. ESX Server systems use a proprietary page-sharing technique to securely eliminate redundant copies of memory pages.
With memory sharing, a workload consisting of multiple virtual machines often consumes less memory than it would when running on physical machines. As a result, the system can efficiently support higher levels of overcommitment.
The amount of memory saved by memory sharing depends on workload characteristics. A workload of many nearly identical virtual machines might free up more than thirty percent of memory, while a more diverse workload might result in savings of less than five percent of memory.