Stop your virtio balloon driver from starving your host memory
By Saket Jain Published Linux/Unix
Stop your virtio balloon driver from starving your host memory
Technical Briefing | 7/29/2026
You set up a bunch of VMs on a single host and figured memory ballooning would save you from OOM killers. It works fine for a while, but then you notice your host starts thrashing even when the VMs claim they are idle. The problem is that the virtio balloon driver inside the guest doesn’t always play nice with the host memory pressure signals.
Why the guest thinks it has more memory than it actually does
The balloon driver effectively tells the kernel to lock up pages and give them back to the host. But if your guest has a high rate of memory allocation, the balloon deflate speed often can’t keep up with the demand. I have seen this cause kernel panics in the guest because it essentially shoots itself in the foot by over-inflating the balloon. Most people just disable it entirely, but you can actually tune the stats collection interval to make it more responsive.
virsh dommemstat vm-name --period 1 --live
- Check if stats polling is actually enabled or the balloon is just stuck
- Set the period to a low integer instead of the default zero which disables periodic reporting
- Watch for the actual balloon current value vs the maximum allowed allocation
When to just give up and pin the memory
If you are running production databases or anything with high random access patterns, just don’t use ballooning. You end up chasing performance ghosts when the host tries to reclaim memory that the guest thought it had locked in hardware. Sometimes you just have to admit that overcommitting memory is a trap, reserve the RAM, and stop trying to squeeze every megabyte out of the host.
