Memory ballooning on Alpine Linux?

Is your hosts RAM utilization below 80%? Balloning will only kick in if hosts RAM is over 80% and if you set "min RAM" lower than "max RAM" for your VM.
 
As far as I know, the host RAM usage has not to be over 80% and min and max RAM can be equal and nevertheless ballooning works...

Can you check that in "Options" of the VM the guest agent is activated and in "Hardware"/"Memory" the Box "Ballooning Device" is ticked?
 
Last edited:
Using the Monitor tab of the VM in the web GUI, you can type (at the bottom of the window) info balloon to check the current balloon size and use balloon <memory size in MB> to temporarily change it. The automatic ballooning, when enabled, will probably shortly thereafter change the size again.
EDIT: Ballooning does not need the QEMU guest agent. It uses the balloon driver (built into modern Linux kernels but separately installed on Windows).
EDIT3: Changed KB into MB, because it is in MB.
 
Last edited:
  • Like
Reactions: ozdjh
Thanks all. The Ballooning Device checkbox is ticked. I have a VM configured with 2GB of memory.

I don't see a change when I use the `balloon <memory in KB>` command.

Code:
# info balloon
balloon: actual=2048 max_mem=2048 total_mem=1993 free_mem=19 mem_swapped_in=80781312 mem_swapped_out=291606528 major_page_faults=11401 minor_page_faults=835070 last_update=1619061591

# balloon 3000000

# info balloon
balloon: actual=2048 max_mem=2048 total_mem=1993 free_mem=20 mem_swapped_in=81375232 mem_swapped_out=294211584 major_page_faults=11510 minor_page_faults=835522 last_update=1619061599

# balloon 1000000

# info balloon
balloon: actual=2048 max_mem=2048 total_mem=1993 free_mem=20 mem_swapped_in=91934720 mem_swapped_out=297951232 major_page_faults=12047 minor_page_faults=839498 last_update=1619061617
 
Thanks all. The Ballooning Device checkbox is ticked. I have a VM configured with 2GB of memory.

I don't see a change when I use the `balloon <memory in KB>` command.
I'm sorry, it is in MB not KB as I mistakenly wrote before. The max_mem=2048 corresponds with your specified 2GB of memory. Try a value below 2048 and the actual= should change accordingly (within the limits of the configuration and memory usage of the VM).
 
Ah I see. I gave balloon 1000 a try and it hasn't increased so I'm not sure that it's working. The configuration is Memory: 2048, Minimum memory: 2048, Ballooning Device: Checked.

Code:
# info balloon
balloon: actual=1000 max_mem=2048 total_mem=945 free_mem=21 mem_swapped_in=483526197248 mem_swapped_out=278703652864 major_page_faults=100607626 minor_page_faults=149290108 last_update=1619145795
 
Ah I see. I gave balloon 1000 a try and it hasn't increased so I'm not sure that it's working. The configuration is Memory: 2048, Minimum memory: 2048, Ballooning Device: Checked.

Code:
# info balloon
balloon: actual=1000 max_mem=2048 total_mem=945 free_mem=21 mem_swapped_in=483526197248 mem_swapped_out=278703652864 major_page_faults=100607626 minor_page_faults=149290108 last_update=1619145795
After the balloon 1000 the VM's memory was reduced to 1000MB (see actual), so manual ballooning does actually work. 945MB was in use and 21MB was free inside the VM.
When the Minimum memory setting is below the Memory setting of the VM, there should be some form of automatic ballooning/redistribution between of available memory over all applicable VMs (per ratio of the VM's Shares setting). Note that any VM with PCI passthrough cannot actually use ballooning because all memory must be locked into actual RAM because PCI devices can do DMA.
If you don't see a reduction in overall host memory usage at 96% (as per your original question), then ballooning is probably already active. Automatic ballooning will only reduce the VM memory down to the Minimum memory setting. For that VM it is the same as the (maximum) Memory setting, so no effect (on total host memory usage).

EDIT: Fixed a typo and added some additional information.
 
Last edited:

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!