RAM usage inconsistent in AlmaLinux VM

HPmoss

Member
May 8, 2023
61
8
13
Online
www.google.co.uk
1684071704548.png

I see descripency in RAM usage reported by Proxmox 7.4 web UI for one of the VM.
The htop screen snapshot is attached as well. Where can I start to get to the root of this issue?
 
Last edited:
This question is asked literally every two or three days here. All of the memory assigned to the VM is "in use" from the host view even if it is not from the guest view. To get guest info to the host side you need to install the guest agent (in the guest) and enable it in the VM setup in Proxmox. Just doing one or the other is not sufficient.
 
Last edited:
Still the same even after installing guest agent inside the VM. VM was also restarted.
Any other suggestion?

PS: I used this command to install the tool: sudo dnf install qemu-guest-agent
 
Last edited:
Hi, is the htop screenshot from inside the VM? If yes, the reason for the discrepancy might be the VM's page cache. You can check by running free -m inside the VM -- see for example [1] for more information.

[1] https://www.linuxatemyram.com/
 
Could you post the output of free -h inside the VM? Do you use ZFS inside the VM by any chance?
 
No ZFS inside or outside VM.
Free tells you that only 170MiB are free. So 7.4GiB - 170MiB = 7.2 GiB of RAM are in use. This reflects what PVE is showing. "Available" is something different than "free". "Free" RAM isn't in use at all. "Available" RAM is in use (in your case 6.6 GiB are used as cache) but can be quickly freed up if needed (for example by dropping the caches). This "available" RAM is what htop is showing, not "free" RAM.

And the QEMU guest agent only helps for Windows VMs to report "available" RAM as "free" RAM. Linux reports "free" RAM as "free" RAM even with the QEMU guest agent installed.
 
Last edited: