If you’re monitoring a large virtual infrastructure, then you might have come across memory ballooning and swapping issues at some point. Although memory ballooning causes swapping issues in a virtual environment, let’s look at what they both are and how it affects individual VM performance.

   

When you setup a VM, you allocate resources for that VM based on usage, user access, and so on. Once you assign resources to a VM, the VM is no longer aware of how much resources are consumed by other VMs in a host. For example, when you have three VMs in a host and two of them are consuming the assigned memory, the third VM will have performance issues. This usually leads to various bottlenecks and you’ll very often find yourself in such situations which leaves you scrambling – troubleshooting to ensure VM performance or availability issues don’t affect end users.

    

Memory ballooning & swapping: How it works and where it fits in your virtual environment

     

Memory ballooning is a memory reclamation method and it is generally not a good thing because it causes performance issues to your VMs. The hypervisor assigns memory resources to all the VMs in your environment. A VM is usually unaware when other VMs have memory contention issues, causing performance problems in the environment. To avoid this, the hypervisor uses a balloon driver which is installed in the guest operating system. This balloon driver identifies if a VM has excess memory resources. Once the balloon driver has identified the memory resource, the balloon driver inflates and pins down the memory resource so the VM does not consume the pinned memory. The balloon driver communicates back to the hypervisor asking the hypervisor to reclaim the pinned memory from the VM.

     

It is up to the hypervisor to allocate more memory to other VMs which have memory contention issues using the balloon driver. One thing to keep in mind is, when there is high memory ballooning, the guest OS is forced to read from the disk, this causes high disk I/O, and it can bring down the performance of the VM. When you think the host is under memory pressure, it’s critical to monitor the memory swap metric for performance issues.

Memory ballooning leads to memory swapping. Memory swapping is also not a good thing because the system swaps to disk and disk is much slower than RAM. All this causes a performance bottleneck. Usually, when there’s excessive memory swapping for a VM, it often indicates there’s memory contention issues on the host.

To proactively find out and address memory issues, you can setup alert criteria. Set thresholds and get notified when there is ballooning or swapping issues. Drill down to see which VMs have performance issues and identify and fix the bottleneck. Watch vExpert Scott Lowe in action as he shows you how to monitor and troubleshoot memory ballooning and swapping issues using a virtualization management software.

 

 

You can read this whitepaper from VMware® to learn more about memory resource management and memory ballooning.