TECHNOLOGY & CERTIFICATION EDITORIAL

Understanding Memory Ballooning in VMware and Virtualisation Systems

Overcommitment is a capacity decision, not free memory

VMware ESXi can power on virtual machines whose combined configured RAM exceeds the host’s physical memory when admission control and resource policies permit it. That arrangement is called memory overcommitment. It can be useful because applications rarely require their entire configured allocation at the same instant, but it creates a shared failure risk: workloads that become active together can demand more physical memory than the host can supply without reclamation. Successful sizing relies on actual working sets, configured limits, reservations, availability headroom and the business cost of unexpected latency.

Consider a host with 128 GiB of usable RAM and virtual machines configured for a combined 168 GiB. The 168 GiB total is not itself proof of immediate trouble. A steady 70 GiB active footprint may fit easily, while a simultaneous reporting job, database rebuild and software upgrade can create damaging pressure. Host overhead, the platform version, NUMA placement and the ability to move workloads to other hosts complicate the arithmetic. A prudent design tests the credible simultaneous peak rather than taking a low daytime average as the sizing target.

ESXi has several mechanisms for avoiding or responding to pressure: page sharing where eligible, guest-cooperative ballooning, memory compression and host-level swapping. These mechanisms have distinct security, resource and performance consequences. They should be understood as interacting options governed by actual host conditions, not a universally guaranteed fixed sequence or a promise that every workload can be safely overcommitted.

Transparent Page Sharing: inside a VM by default

Transparent Page Sharing (TPS) can recognize eligible memory pages with identical contents and allow them to share physical storage. It is not equivalent to scanning all guest RAM and removing duplicates indiscriminately. Page size, contents, timing and security configuration determine which pages qualify. Broadcom’s documented ESXi defaults use page-sharing salting: different virtual machines ordinarily receive different salts, so intra-VM duplicate sharing can occur while inter-VM sharing between unrelated guests is disabled by default.

Older explanations of TPS often imply that dozens of identical Windows or Linux guests automatically share enormous amounts of memory. That is not a safe planning assumption for current deployments. Administrators should inspect host and VM sharing counters, understand the large-page effects and evaluate the actual workload. Allowing inter-VM TPS is a deliberate configuration and isolation choice that can require compatible VM salt settings; a possible reduction in memory use does not override the security reason for the default separation.

In a test cluster, start by recording configured memory, granted memory, consumed memory and any reported shared-page savings. Run similar guests without changing security defaults, then test whether the memory counters demonstrate meaningful savings. Do not advertise a consolidation-ratio benefit based only on the number of apparently identical operating systems. Evidence from one platform version or memory-page size should not be generalized to all ESXi installations.

Ballooning: let the guest choose what to reclaim

Memory ballooning uses the VMware Tools memory-control driver in a guest operating system. When the hypervisor needs to reclaim capacity, it can request that the driver allocate guest physical memory; the guest must then decide which caches or pages to release or move to its own backing store. ESXi can reclaim the corresponding host memory. Compared with indiscriminate host swapping, this lets the guest use some knowledge of memory importance, but ballooning is not inherently without performance cost.

If a guest has unused caches and genuine spare capacity, ballooning may have little visible effect. If it is already under pressure, the same request can force guest-level paging, cache eviction and increased storage latency. Database buffer pools, in-memory analytics, latency-sensitive transaction services and JVM-based workloads can react differently from lightly used application servers. Observe response time and in-guest page-fault or swap activity, not only a benign-looking hypervisor balloon counter.

Ballooning depends on the supported driver being installed and functional, and it has limits. A missing or unresponsive VMware Tools component means the hypervisor may need other reclamation mechanisms. An unchanged high balloon size can also reflect stale state rather than current host pressure; correlate it with host free memory, balloon target, swap usage and application behavior before deciding that an immediate outage is imminent. Use ESXi version-appropriate Broadcom guidance when interpreting such cases.

Compression and swapping have different costs

ESXi memory compression can reduce the amount of physical RAM needed for compressible pages and avoid some slower disk swaps. Its benefit depends on page content and CPU cost; compressed pages still have to be decompressed before use. Compression is not a guarantee that memory pressure will be invisible, and a latency-sensitive application can experience the overhead even when host disks show little swap traffic.

Host-level swapping moves guest physical pages to backing storage when the platform needs to reclaim more RAM. Reading those pages back is much slower than reading RAM, and the effect grows when a frequently used working set is swapped. The precise decisions depend on memory targets, limits, version and configuration rather than a universal “swap only after every other mechanism has failed” rule. Distinguish host swapping from in-guest swapping: the former is controlled by ESXi, while the latter is initiated by the guest operating system because its own memory management determines a need. They can occur together, creating severe latency.

For example, an analytics VM may have its memory constrained by an ESXi resource limit while the physical host still displays some free memory. Treating that behavior as proof of total host exhaustion sends the incident in the wrong direction. Inspect the VM limit and resource-pool policy, current entitlement, guest committed memory, ballooning and swap rates before deciding whether to increase physical capacity or remove an artificial cap.

Configured, granted, consumed, active and entitlement are not interchangeable

Configured memory is the RAM presented to a VM in its configuration. Granted memory represents guest physical memory backed by host memory, which can differ from configured memory; VMware’s published counters distinguish granted from consumed memory when sharing reduces physical use. Consumed memory estimates host machine memory used for guest memory and does not include every form of VM overhead in the same metric. A large configured value alone says little about actual host demand.

Active memory is an estimate based on sampling, not a direct guest-OS measurement of application working set. It should be interpreted alongside guest performance counters rather than used as the one true capacity figure. Entitlement describes scheduler allocation expectations under current demand and resource-control policies, including reservations, shares and limits. Those controls become especially important during contention.

Reservations protect a minimum memory entitlement, not a universal guarantee of a fixed application response time; shares express relative priority during contention and cannot make new memory appear; limits cap resource assignment and can cause unnecessary reclamation or poor performance even where a host has additional capacity. A fully reserved VM may be protected from certain host reclamation operations, but an inadequately sized guest can still page internally. Use the documented platform semantics rather than claiming every reservation grants absolute immunity from latency or memory pressure.

NUMA and cluster scheduling change the effective headroom

Large hosts often have multiple non-uniform memory access (NUMA) nodes. A CPU may reach local memory more efficiently than remote memory attached to another node. The hypervisor can optimize VM placement, but oversized or poorly placed VMs and imbalanced memory demand can still increase remote access. Monitor local versus remote memory use where the platform exposes useful counters. A cluster whose aggregate RAM appears sufficient can have one host or NUMA node under disproportionate pressure.

DRS and vMotion can help distribute workloads and respond to changing demand, subject to migration compatibility, licensing, network capacity, available target resources and policy restrictions. They cannot guarantee that all pressure will disappear if every host becomes busy together. Capacity planning should model the loss of one host, planned maintenance and simultaneous business peaks. A successful DRS move also does not replace the need to investigate repeated application memory growth or aggressive host swapping.

Investigate a real memory-pressure incident

Suppose users report that an order-processing service slows sharply at 14:00. A dashboard shows elevated memory utilization on one ESXi host; two VMs have ballooning, one has host swap-in activity and another has high guest swap. First confirm the user-visible symptom and time of onset. Record host free memory, consumed memory, NUMA context, vMotion events and resource-pool settings. Read ballooned memory alongside target, compression and host swap counters, and review VM limits, reservations and entitlement.

Next compare the affected VM’s in-guest memory utilization, paging, storage latency and application logs. Does the performance issue track the reporting job? Is the VM hitting its own configured limit? Did a large guest-page cache grow, or did host-level swapping begin only after the scheduled batch started? A memory allocation of 16 GiB and an estimated active footprint of 4 GiB are insufficient evidence on their own; gather a time series and correlate with actual transactions and failure modes.

Test one reversible mitigation at a time. If a nonessential batch workload creates the peak, reschedule it. If a limit is causing artificial scarcity, change it through approved change control with before/after counters. If the whole cluster lacks failover headroom, provision capacity or redistribute workloads after verifying the effect on protected VMs. Record time to improvement, swap-rate reduction and latency change. Do not disable memory-sharing security settings or increase reservations blindly to improve a single metric.

Use measured risk to set a consolidation limit

The correct overcommitment ratio depends on workload concurrency, actual working sets, failover obligations, permitted performance degradation and business criticality. A development fleet that is rarely active together may justify more aggressive overcommitment than a production database cluster or low-latency healthcare service. Review simultaneous peaks, not average configured-to-physical RAM ratio alone. Reassess when a system adds users, moves to a different CPU/NUMA topology or changes its release schedule.

Build a repeatable dashboard around host free and consumed memory, VM active/granted/consumed counters, balloon targets and actual ballooning, compressed memory, host swap rates, guest page faults, and critical application latency. Set alerts that distinguish a harmless temporary spike from sustained user-visible degradation. Use version-appropriate Broadcom performance documents for counter definitions; several labels that sound similar do not measure the same memory quantity.

The practical engineering goal is neither zero overcommitment nor the highest virtual-machine count. It is predictable service under plausible simultaneous demand, with documented security defaults, enough recovery headroom and measurable response when a host becomes constrained. A defensible VMware memory strategy preserves isolation, tests contention instead of assuming a perfect reclamation sequence, and gives operators enough evidence to distinguish an under-sized application from a cluster-wide resource shortage.

Back to Insights
Explore what matters. Knowledge that goes beyond the exam.
Explore ExamTopics