KVM - The Linux Kernel-Based Virtual Machine
News, Blogs and Resources on the Linux (KVM) Kernel-Based Virtual Machine

Memory ballooning feature coming soon to KVM

Patches have been submitted by KVM developer Anthony Liguori featuring dynamic ballooning of kvm guest virtual machine memory. Bear in mind though that in order for this feature to work there are two requirements. These requirements are that your linux kvm host must be running at least kernel 2.6.27 in order to use the mmu notifier operations and secondly, you cannot run kvm with the –no-kvm option which essentially means that kvm “acceleration” must be enabled. These are the only requirements. You can probably expect to see this feature released sometime soon so it would be useful to have an idea of what you can expect.


What is memory ballooning

Memory ballooning allows you to have your guest dynamically change it’s memory usage by evicting unused memory during runtime. This is a useful feature because it reduces the impact your guest can have on memory usage of your host by giving up unused memory back to the host.


Using the balloon option

The patches submitted add two commands to the monitor interface. One command is an informational command showing current memory usage of your virtual machine and the other command is the command to dynamically change your guest memory.

The info command is useful in verifying that your virtual machine has actually changed it’s memory usage. The syntax for this command is as follows which will show memory usage in MB.

(qemu) info balloon

The syntax for the command to actually perform memory ballooning is as follows.

(qemu) balloon 400

This command will request your guest machine to change it’s memory allocation to the specified amount in MB which is 400MB in the example above. You will be able to verify this by using the info balloon command again.

With the current rapid pace of KVM development you will be able to test this feature in the near future, just get your 2.6.27 kernel ready.

See Also


Post new comment

The content of this field is kept private and will not be shown publicly.
Type the characters you see in this picture. (verify using audio)
Type the characters you see in the picture above; if you can't read them, submit the form and a new image will be generated. Not case sensitive.