Memory usage is wrong

gretz

New Member
Jan 28, 2022
12
3
3
39
I have a VM runing debian 11 and it shows that memory is full on the interface but in fact it is used by buffer/cache :

total used free shared buff/cache available
Mem: 1982 68 78 0 1835 1735
Swap: 974 0 974

Screenshot_20220129_110552.png
 
Proxmox is right. RAM used for buffer/cache ist still "used" RAM. Proxmox will report how much of your RAM the VM is using and thats 1.87 GiB even if most of that is just cached data. Your VM is using 1.87 GiB so that wastes 1.87 GiB of your physical RAM that can neither be used by the host or any other guests anymore.
Your free -h run inside the guest tells you "78 MB free" and that is basically what PVE is showing. Everything that is not "free" is used, no matter where it is used for (and proxmox can't see where it is used for, only your guest itself knows that).

See here: LinuxAteMyRAM.com
 
Last edited:
Proxmox is right. RAM used for buffer/cache ist still "used" RAM. Proxmox will report how much of your RAM the VM is using and thats 1.87 GiB even if most of that is just cached data. Your VM is using 1.87 GiB so that wastes 1.87 GiB of your physical RAM that can neither be used by the host or any other guests anymore.
Your free -h run inside the guest tells you "78 MB free" and that is basically what PVE is showing. Everything that is not "free" is used, no matter where it is used for (and proxmox can't see where it is used for, only your guest itself knows that).

See here: LinuxAteMyRAM.com
My point is that I'm not sure it is pertinent to consider buffer/cache as used memory because it will almost always be full given the OS disk caching behaviour.
 
Last edited:
See it from the point of the hypervisor. It doesn't matter if the guest can quickly free up RAM used for caching if a process inside the guest is needing more RAM. The hypervisor can't know whats going on inside the guest and can't drop cached data like the guest could. All the hypervisor cares about is how much of the physical RAM the guest is actually using and there it makes no difference where RAM is used for. Its either unused (free) RAM or used RAM.
If you want to monitor your guests metrics from the guests point of view you could setup a graphana/zabbix/checkmk LXC/VM which could use agents to collect display this data.
 
Last edited:
  • Like
Reactions: melroy89
i get your point frm the hypervisor piint of view, but this graphic is meant for humans ? if non tech savy person looks at this info through the webui he'll wrongly assume that this VM needs more memory ...
 
i get your point frm the hypervisor piint of view, but this graphic is meant for humans ? if non tech savy person looks at this info through the webui he'll wrongly assume that this VM needs more memory ...
Agreed, even for the tech savvy... you're forced to go into the vm to get those details. Ideally that's available all the way out in Proxomox... having said that, I see why Proxmox does what it does.
 

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!