Technical information
VMware, Inc. 23
Chapter 2 ESX and Virtual Machines
ESX Memory Considerations
This subsection provides guidance regarding memory considerations in ESX.
Memory Overhead
Virtualization causes an increase in the amount of physical memory required due to the extra memory needed
by ESX for its own code and for data structures. This additional memory requirement can be separated into
two components:
1 A system-wide memory space overhead for the service console (typically 272MB, but not present in ESXi)
and for the VMkernel (typically about 100MB).
2 An additional memory space overhead for each virtual machine.
The per-virtual-machine memory space overhead includes space reserved for the virtual machine devices
(e.g., the SVGA frame buffer and several internal data structures maintained by the VMware software stack).
These amounts depend on the number of vCPUs, the configured memory for the guest operating system, and
whether the guest operating system is 32-bit or 64-bit.
ESX provides optimizations such as memory sharing (see “Memory Overcommit Techniques” on page 23) to
reduce the amount of physical memory used on the underlying server. In some cases these optimizations can
save more memory than is taken up by the overhead.
The VMware Resource Management Guide, listed in “Related Publications” on page 8, includes a table with
detailed memory space overhead numbers.
Memory Sizing
Carefully select the amount of memory you allocate to your virtual machines. You should allocate enough
memory to hold the working set of applications you will run in the virtual machine, thus minimizing
swapping, but avoid over-allocating memory. Allocating more memory than needed unnecessarily
increases the virtual machine memory overhead, thus using up memory that could be used to support
more virtual machines.
When possible, configure 32-bit Linux virtual machines with no more than 896MB of memory. 32-bit
Linux kernels use different techniques to map memory on systems with more than 896MB. These
techniques impose additional overhead on the virtual machine monitor and can result in slightly reduced
performance.
Memory Overcommit Techniques
ESX uses three memory management mechanisms — page sharing, ballooning, and swapping — to
dynamically reduce the amount of machine physical memory required for each virtual machine.
Page Sharing: ESX uses a proprietary technique to transparently and securely share memory pages
between virtual machines, thus eliminating redundant copies of memory pages. Page sharing is used
by default regardless of the memory demands on the host system.
Ballooning: If the virtual machine’s memory usage approaches its memory target, ESX uses
ballooning to reduce that virtual machine’s memory demands. Using a VMware-supplied vmmemctl
module installed in the guest operating system as part of VMware Tools suite, ESX can cause the
guest to relinquish the memory pages it considers least valuable. Ballooning provides performance
closely matching that of a native system under similar memory constraints. To use ballooning, the
guest operating system must be configured with sufficient swap space.
Swapping: If ballooning fails to sufficiently limit a virtual machine’s memory usage, ESX also uses
host-level swapping to forcibly reclaim memory from a virtual machine. Because this will swap out
active pages, it can cause virtual machine performance to degrade significantly.