[SOLVED] VM usable RAM drops after running for some minutes

VGE

Member
Apr 28, 2020
28
2
8
Hi guys,

Im running a ubuntu vm and allocated 15gb of ram to it, my server has 32gb total and is only using 60% at the moment. When I reboot the vm and run HTOP it shows all 15gb but after some time it go's to 1,64gb which causes issues like out of memory killer.

Anyway to fix this? QEMU and Ballooning are both on
 

Attachments

  • htop printscreen.JPG
    htop printscreen.JPG
    21 KB · Views: 12
  • proxmox vm.JPG
    proxmox vm.JPG
    20.1 KB · Views: 13
What did you set as a min RAM for your ballooning? IF you for example set your ballooning to use 2GB min and 15GB max RAM for that VM that would be normal. As soon as your hosts RAM would exceed 80% utilization ballooning will start and slowly remove RAM from that VM until your hosts ram gets below 80% utilization or your guests "min RAM" is reached. Ballooning doesn't care if that VM needs that RAM or not. It will just remove it even if that means that the VMs OOM killer kicks in or the VM might even crash.
 
Last edited:
@Dunuin Ok so that meens I need to reserve more minimal RAM? Im running ZFS which tries to use a lot off RAM.
 
For max RAM you shouldn't give that VM more RAM than it actually needs. That way the guests OS won't waste RAM by using it for caching. So if your OS + programs for example only need 8 GB RAM to be able to operate, give it 8 not 15 GB.
For min RAM you should give that VM atleast the amount of RAM that the OS + all programs at minimum need. So if you atleast need 6GB RAM so that OOM killer don't kicks in, set the "min RAM" to 6GB and not lower.
That way your VM always got that 6GB and if the host got some spare RAM (host RAM utilization is below 80%) it will increase the VMs RAM dynamically up to 8GB.
Ballooning can't do magic. Its not there to allow you to overprovision your RAM. OS + ZFS + all VMs/LXCs RAM combined should be less than your servers total RAM. So if you got 32GB GB RAM and you don't want to lower the ARC (should be UP TO 16GB now) you got something like 12-23 GiB of RAM that you can assign to all VMs/LXCs combined.
 
Last edited:
  • Like
Reactions: VGE
@Dunuin thats a very logical and clear explanation!! Thank you for that. Ill rethink my RAM allocation and buy some more RAM as I do need some VM's to have more RAM Available as I cannot predict in advance what usage new software will use for some testing im doing.
 

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!