beautypg.com

Memory tax for idle virtual machines, Memory reclamation, Memory balloon driver – VMware vSphere vCenter Server 4.0 User Manual

Page 31

background image

An ESX/ESXi 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.

n

Shares — ESX/ESXi hosts use a modified proportional-share memory allocation policy. Memory shares

entitle a virtual machine to a fraction of available physical memory.

n

Working set size —ESX/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,”

on page 99.

Memory Tax for Idle Virtual Machines

If a virtual machine is not actively using all of its currently allocated memory, ESX/ESXi charges more for idle

memory than for memory that is in use. This is done to help prevent virtual machines from hoarding idle

memory.
The idle memory tax is applied in a progressive fashion. The effective tax rate increases as the ratio of idle

memory to active memory for the virtual machine rises. (In earlier versions of ESX that did not support

hierarchical resource pools, all idle memory for a virtual machine was taxed equally.)
You can modify the idle memory tax rate with the

Mem.IdleTax

option. Use this option, together with the

Mem.SamplePeriod

advanced attribute, to control how the system determines target memory allocations for

virtual machines. See

“Set Advanced Host Attributes,”

on page 99.

N

OTE

In most cases, changes to

Mem.IdleTax

are not necessary nor appropriate.

Memory Reclamation

ESX/ESXi hosts can reclaim memory from virtual machines.
An ESX/ESXi host allocates the amount of memory specified by a reservation directly to a virtual machine.

Anything beyond the reservation is allocated using the host’s physical resources or, when physical resources

are not available, handled using special techniques such as ballooning or swapping. Hosts can use two

techniques for dynamically expanding or contracting the amount of memory allocated to virtual machines.

n

ESX/ESXi systems use a memory balloon driver (

vmmemctl

), loaded into the guest operating system

running in a virtual machine. See

“Memory Balloon Driver,”

on page 31.

n

ESX/ESXi systems page from a virtual machine to a server swap file without any involvement by the guest

operating system. Each virtual machine has its own swap file.

Memory Balloon Driver

The memory balloon driver (

vmmemctl

) collaborates with the server to reclaim pages that are considered least

valuable by the guest operating system.
The driver uses a proprietary ballooning technique that provides predictable performance that closely matches

the behavior of a native system under similar memory constraints. This technique increases or decreases

memory pressure on the guest operating system, causing the guest to use its own native memory management

algorithms. When memory is tight, the guest operating system determines which pages to reclaim and, if

necessary, swaps them to its own virtual disk. See

Figure 3-2

.

Chapter 3 Managing Memory Resources

VMware, Inc.

31

This manual is related to the following products: