Specifications

VMware, Inc. 349
Chapter 12 VMware ESX Server Resource Management
Virtual!machines!that!are!not!actively!using!their!allocated!memory!automatically!have!
their!effective!number!of!shares!reduced,!by!levying!a!tax!on!idle!memory.! This!
“memory!tax”!prevents!virtual!machines!from!hoarding!idle!memory.!A!virtual!
machine!is!charged!more!for!an!idle!page!than!for!a!page!that!it
!is!actively!using.!
The!MemIdleTax!configuration!option!provides!explicit!control!over!the!policy!for!
reclaiming!idle!memory.!Use!this!option,!together!with!the!MemSamplePeriod!
configuration!option,!to!control!how!the!system!reclaims!memory.!In!most!cases,!
changes!shouldn’t!be!necessary.!For!information!on!using!these!options,!see!“Service!
Console!Commands”!
on!page 369.
ESX!Server!estimates!the!working!set!for!a!virtual!machine!by!monitoring!memory!
activity!over!successive!periods!of!virtual!machine!virtual!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!has!been!reclaimed!is!be!able!
to!ramp!up!quickly!to!its!full!sharebased!allocation!once!it!starts!using!its!memory!
more!actively.!You!can!modify!the!default!monitoring!period!of!60!seconds!by!adjusting!
the!MemSamplePeriod!configuration!option.
!
Reclaiming Memory from Virtual Machines
ESX!Server!uses!two!techniques!for!dynamically!expanding!or!contracting!the!amount!
of!memory!allocated!to!virtual!machines:!a!VMware!supplied!vmmemctl!module!that!is!
loaded!into!the!guest!operating!system!running!in!a!virtual!machine,!and!swapping!
pages!from!a!virtual!machine!to!a!server!swap!file!without!any!involvement
!by!the!
guest!operating!system.
The!preferred!mechanism!is!the!vmmemctl!driver,!which!cooperates!with!the!server!to!
reclaim!pages!that!are!considered!least!valuable!by!the!guest!operating!system.!The!
vmmemctl!driver!uses!a!proprietary!“ballooning”!technique!that!provides!predictable!
performance!that!closely!matches!the!behavior!of!a!native!system
!under!similar!
memory!constraints.!It!effectively!increases!or!decreases!memory!pressure!on!the!guest!
operating!system,!causing!the! guest!to!invoke!its!own!native!memory!management!
algorithms.!
When!memory!is!tight,!the!guest!operating!system!determines!which!pages!to!reclaim!
and,!if!necessary,!sw aps!them!to!its!own!virtual!disk.!
The!guest!operating!system!must!
be!configured!with!sufficient!swap!space.!Some!guest!operating!systems!have!
additional!limitations.!See!the!notes!in!“Managing!Memory!Resources!from!the!Service!
Console”!on!page 352.!You!can!limit!the!amount!of!memory!reclaimed!using!vmmemctl!
by!setting!the!sched.mem.maxmemctl!option.!This!option!specifies!the!maximum
!
amount!of!memory!that!you!can!reclaim!from!a!virtual!machine!in!megabytes!(MB).