Monitor Memory Ballooning

Discussions related to using VirtualBox on Windows hosts.
Post Reply
Skely
Posts: 8
Joined: 28. Sep 2021, 19:03

Monitor Memory Ballooning

Post by Skely »

Hi guys, is there a way to see the free memory left for ballooning?
I am currently running 10 VMs. And all of them have ballooning turned on.
In my case,

Each VM are set to 2GB. 2GB x 10 VMs = 20GB of RAM
Total VM running: Total 10GB of RAM.
VM OS: Windows Server 2012 r2.

I have 32GB of RAM, it shows 8GB left in Task Manager.
Is there a way to see the free memory left for ballooning? Any software or ideas?
fth0
Volunteer
Posts: 5668
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: Monitor Memory Ballooning

Post by fth0 »

For starters, I assume that you've read 4.10.1. Memory Ballooning and disabled large pages accordingly.

In the VirtualBox statistics inside a VBox.log file, you'll find some counters in the /GMM/VM/* and /PGM/Page/* trees, but you'll need some background knowledge to interpret them. If you're interested in seeing those statistic counters in action, start your VM from a CMD shell using VirtualBoxVM --startvm "VM name" --debug.
LiangLiang
Posts: 13
Joined: 28. Sep 2021, 20:31

Memory ballooning monitoring

Post by LiangLiang »

Is there a way to monitor all vms with the accurately memory usage with excluded the “free” memory from ballooning memory?
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Monitor Memory Ballooning

Post by scottgus1 »

So memory ballooning is almost never mentioned on the forum, then two new members ask almost the same question about it within 2 hours. :lol:

LiangLiang, keep an eye on Skely's topic here.
Skely
Posts: 8
Joined: 28. Sep 2021, 19:03

Re: Monitor Memory Ballooning

Post by Skely »

fth0 wrote:
In the VirtualBox statistics inside a VBox.log file, you'll find some counters in the /GMM/VM/* and /PGM/Page/* trees, but you'll need some background knowledge to interpret them. If you're interested in seeing those statistic counters in action, start your VM from a CMD shell using VirtualBoxVM --startvm "VM name" --debug.
Hi. I did try with this code in cmd.

Code: Select all

 VBoxManage controlvm "VM name" guestmemoryballoon n 
I have some experience with hyper-v which have dynamic memory (memory ballooning). With hyper-v, it allows me to set the minimum memory and maximum memory for the vm.
May I know what are the “n” referring in the code, minimum or maximum memory?

Is there a way to monitor all vms with accurately memory usage with excluded the “free” memory from ballooning? Instead of one by one monitoring.


Thanks, scottgus1, Liang Liang is my friend who looking for the answers also. :D
Last edited by Skely on 28. Sep 2021, 21:18, edited 1 time in total.
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Monitor Memory Ballooning

Post by scottgus1 »

From the manual under Vboxmanage controlvm:
--guestmemoryballoon <size> Sets the default size of the guest memory balloon. This is the memory allocated by the Oracle VM VirtualBox Guest Additions from the guest operating system and returned to the hypervisor for reuse by other virtual machines. <size> must be specified in megabytes. The default size is 0 megabytes.
The "n" amount appears to be how many megabytes one takes away from a VM to allow other VMs to use it.
fth0
Volunteer
Posts: 5668
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: Monitor Memory Ballooning

Post by fth0 »

Skely wrote:I have some experience with hyper-v which have dynamic memory (memory ballooning). With hyper-v, it allows me to set the minimum memory and maximum memory for the vm.
May I know what are the “n” referring in the code, minimum or maximum memory?
Despite using the same term, AFAIU the Hyper-V and VirtualBox implementations of Memory Ballooning don't have much in common. "n" is simply a fixed amount of memory, as described in 4.10.1. Memory Ballooning.
Skely wrote:Is there a way to monitor all vms with accurately memory usage with excluded the “free” memory from ballooning? Instead of one by one monitoring.
AFAIK, there is no ready-made way to do that. You can only program something yourself, starting with commands like VBoxManage debugvm "VM name" statistics --pattern="/GMM/VM/*" to query the current values.
Post Reply