Monitor Memory Ballooning

Discussions related to using VirtualBox on Windows hosts.

Monitor Memory Ballooning

Postby Skely » 28. Sep 2021, 19:12

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?
Skely
 
Posts: 2
Joined: 28. Sep 2021, 19:03

Re: Monitor Memory Ballooning

Postby fth0 » 28. Sep 2021, 19:38

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.
fth0
Volunteer
 
Posts: 2502
Joined: 14. Feb 2019, 03:06
Location: Germany
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...

Memory ballooning monitoring

Postby LiangLiang » 28. Sep 2021, 20:44

Is there a way to monitor all vms with the accurately memory usage with excluded the “free” memory from ballooning memory?
LiangLiang
 
Posts: 1
Joined: 28. Sep 2021, 20:31

Re: Monitor Memory Ballooning

Postby scottgus1 » 28. Sep 2021, 20:47

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.
scottgus1
Site Moderator
 
Posts: 13389
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Monitor Memory Ballooning

Postby Skely » 28. Sep 2021, 21:00

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   Expand viewCollapse view
 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.
Skely
 
Posts: 2
Joined: 28. Sep 2021, 19:03

Re: Monitor Memory Ballooning

Postby scottgus1 » 28. Sep 2021, 21:05

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.
scottgus1
Site Moderator
 
Posts: 13389
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Monitor Memory Ballooning

Postby fth0 » 28. Sep 2021, 21:29

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.
fth0
Volunteer
 
Posts: 2502
Joined: 14. Feb 2019, 03:06
Location: Germany
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...


Return to VirtualBox on Windows Hosts

Who is online

Users browsing this forum: No registered users and 50 guests