A host allocates the memory specified by the Limit parameter to each virtual machine, unless memory is overcommitted. ESXi never allocates more memory to a virtual machine than its specified physical memory size.
For example, a 1GB virtual machine might have the default limit (unlimited) or a user-specified limit (for example 2GB). In both cases, the ESXi host never allocates more than 1GB, the physical memory size that was specified for it.
When memory is overcommitted, each virtual machine is allocated an amount of memory somewhere between what is specified by Reservation and what is specified by Limit. The amount of memory granted to a virtual machine above its reservation usually varies with the current memory load.
A host determines allocations for each virtual machine based on the number of shares allocated to it and an estimate of its recent working set size.
- Shares — ESXi hosts use a modified proportional-share memory allocation policy. Memory shares entitle a virtual machine to a fraction of available physical memory.
- Working set size — ESXi hosts estimate the working set for a virtual machine by monitoring memory activity over successive periods of virtual machine execution time. Estimates are smoothed over several time periods using techniques that respond rapidly to increases in working set size and more slowly to decreases in working set size.
This approach ensures that a virtual machine from which idle memory is reclaimed can ramp up quickly to its full share-based allocation when it starts using its memory more actively.Memory activity is monitored to estimate the working set sizes for a default period of 60 seconds. To modify this default , adjust the Mem.SamplePeriod advanced setting. See Set Advanced Host Attributes.