Ram usage & Proxmox

Talha

Active Member
Jan 13, 2020
57
0
26
29
Hello. I allocate 8GB of RAM to a VM. The VM consumes about 1GB of RAM when it is first turned on. When I check via "htop" from within the Proxmox server, the VM consumes 1GB of RAM. So far everything is correct. When I temporarily do an operation in the VM and increase the RAM consumption to %100 and reduce it back to 1GB, that VM appears to be consuming %100 in the Proxmox server until the server is completely shut down and restarted.
Simply, while a VM uses 1GB of RAM, Proxmox sees consumption as 8GB. Because it has previously gone up to 8GB consumption.

On Windows operating systems are booting, it uses all of the RAM for testing purposes and frees it back up. However, due to this problem, even if the Windows operating systems virtio driver is installed and the ballooning feature is turned on, Proxmox's RAM consumption always seems high.

My English is not very good, I hope you understand. How can I solve this problem? Can someone help me please?
 
Please have a look at all the other topics about Proxmox/High RAM/memory usage. It's usually filesystem cache. Or it is virtual memory allocation and not actual memory usage. Or you just need to limit the VM memory to what you find acceptable. Also make sure to install and enable QEMU Guest Agent.
 
All VMs will consume all RAM you assign to them. If the GuestOS doesn't need that RAM for running services, it will use it for caching. Free RAM is wasted RAM, so every OS will try to keep as less RAM free as possible. If your VM doesn't really need that much RAM, don't give it that much, so it will "waste" less RAM (which then other VMs or the PVE host could make use of).
 
Last edited:
  • Like
Reactions: leesteken
Please have a look at all the other topics about Proxmox/High RAM/memory usage. It's usually filesystem cache. Or it is virtual memory allocation and not actual memory usage. Or you just need to limit the VM memory to what you find acceptable. Also make sure to install and enable QEMU Guest Agent.
All VMs will consume all RAM you assign to them. If the GuestOS doesn't need that RAM for running services, it will use it for caching. Free RAM is wasted RAM, so every OS will try to keep as less RAM free as possible. If your VM doesn't really need that much RAM, don't give it that much, so it will "waste" less RAM (which then other VMs or the PVE host could make use of).

While the VM consumption is 442MB in Summary, when I check the Proxmox server, I see the actual consumption of the VM on htop is 8237MB. This is exactly my problem. Ballooning is not working I guess.


1669329340971.png
1669329380202.png
 
While the VM consumption is 442MB in Summary, when I check the Proxmox server, I see the actual consumption of the VM on htop is 8237MB. This is exactly my problem. Ballooning is not working I guess.
Thats not how ballooning will work. Ballooning will only kick it when your hosts RAM usage exceeds 80% and it will only steal RAM from the VM when the "Min RAM" is lower than your allocated RAM. And it won't care if your VM needs that RAM or not. It will slowly steal the guests RAM until the hosts RAM usage drops below 80% or until "Min RAM" of the VM is reached. The VM has to handle this. If you set your "Min RAM" too low the guestOS will have to kill your services after all cache has been dropped.
And if you use any PCI passthrough ballooning won't work at all, as DMA requires to be able to access every bit of RAM at any time.

What guest OS are you running? If it is linux check what free -h inside the VM is reporting. Not sure what the command is for windows. Also keep in mind that "free" and "available" is something different.
 
Last edited:
  • Like
Reactions: Talha and leesteken
Thats not how ballooning will work. Ballooning will only kick it when your hosts RAM usage exceeds 80% and it will only steal RAM from the VM when the "Min RAM" is lower than your allocated RAM. And it won't care if your VM needs that RAM or not. It will slowly steal the geusts RAM until the hosts RAM usage drops below 80% or until "Min RAM" of the VM is reached. The VM has to handle this. If you set your "Min RAM" too low the guestOS will have to kill your services after all cache has been dropped.
And if you use any PCI passthrough ballooning won't work at all, as DMA requires to be able to access every bit of RAM at any time.

What guest OS are you running? If it is linux check what free -h inside the VM is reporting. Not sure what the command is for windows. Also keep in mind that "free" and "available" is something different.
I checked VM configuration now. I noticed that the minimum RAM values are same with the RAM. Thank you very much for the information.
 
Here the task manager of my German Win11:
1669331323665.png

So Win11 reports to use 48% RAM but its actually using more like 75% of RAM, because it counts RAM used for caching as "available" RAM. But "available" RAM is still "used" RAM and not "free" RAM. So 75% + virtualization overhead of the KVM process will be consumed of the real physical RAM of the PVE host.
If I would copy some folders and not just surfing the Proxmox forums, the cache would grow and "free" RAM would shrink to nearly zero.
 
Last edited:
  • Like
Reactions: sikh and Talha

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!