Wrong memory usage for one VM

micfrip

Renowned Member
Sep 19, 2013
23
0
66
Hi,

I have a Proxmox instance running only three KVM machines.

I noticed that the RAM usage is always full (taking almost the 32Gb of ram) but when I type
inside the VM, the reality is completely different (only 8Gb used).

The KVM guest agent is installed and ballooning is disabled.

Many thanks for your help,


Michaël
 
Just to clarify - you are saying Proxmox with 32Gb of RAM is showing near full usage, but in one of three VMs you are seeing 8Gb RAM used?

If all three VMs are similar, then 3 * 8 = 24, which is almost 32 and shouldn't be a surprise. Or do you mean something else?
 
Sorry, I should have added more details.

The host is a beast with 128Gb of ram. The VM is consuming alone all the allocated ram for it (32 Gb). The other VM does not have this ram issue.
 

Attachments

  • hostspecs.png
    hostspecs.png
    26.6 KB · Views: 71
  • vmspecs.png
    vmspecs.png
    16.9 KB · Views: 70
Thank you for your reply but the problem is more about the value displayed in Proxmox itself that does not match with the real value inside the VM.
Actually, I can live with it but I know I cannot trust this summary value.
 
Thank you for your reply but the problem is more about the value displayed in Proxmox itself that does not match with the real value inside the VM.
Actually, I can live with it but I know I cannot trust this summary value.

How should PVE know how much space is used in a guest? AFAIK, the full memory is allocated on start and also checked if there is enough available, if not, the VM does not start.
 
I was thinking also in that way but what is the purpose of having a global status on the VM from Proxmox if the ram is always 95% full???
The other strange point is that my other two VM do not seems to behave the same.
At my work, we use Vmware ESX with a bunch of the same OS (Centos) and Vsphere shows the correct values so I guess it is possible to make it work.

Last point, when I do a 'ps' in the host, the results are the same as Proxmox shows so it looks like it is coming from inside the KVM process itself.
 
I was thinking also in that way but what is the purpose of having a global status on the VM from Proxmox if the ram is always 95% full???
The other strange point is that my other two VM do not seems to behave the same.
At my work, we use Vmware ESX with a bunch of the same OS (Centos) and Vsphere shows the correct values so I guess it is possible to make it work.

Last point, when I do a 'ps' in the host, the results are the same as Proxmox shows so it looks like it is coming from inside the KVM process itself.
I think I am starting to get the point. Linux is caching the available RAM in the guest but still shows it as "available". However, Proxmox does see it because, I guess he evaluates the KVM process footprint on the system.

Maybe the right amount of RAM could be raised to the host from the guest through the QEMU guest agent?
 
I think I am starting to get the point. Linux is caching the available RAM in the guest but still shows it as "available". However, Proxmox does see it because, I guess he evaluates the KVM process footprint on the system

Yes, Linux does that (as do other unices).

Last point, when I do a 'ps' in the host, the results are the same as Proxmox shows so it looks like it is coming from inside the KVM process itself.

ps? Did you mean free? That matches for me.
 
I'm new to Proxmox and ran across this post. I too am seeing, what I think to be, the same issue. VM Summary metrics reports that almost all of the Allocated RAM for the VM is used but the OS reports that most of the Allocated RAM is free. I set up two identical VM's, one running Ubuntu 20.04 and one running Debian 10. The VM running Ubuntu is showing the discrepancy. The VM running Debian looks as expected. I've run VMs on ESXi for years and I personally have never seen the VM Summary metrics so far off from that of the VM. So, like you, I questioned what I was seeing. I posted my issue here: https://forum.proxmox.com/threads/summary-mem-usage-does-not-match-os-free.86274/

I stumbled across this post https://www.reddit.com/r/Proxmox/comments/eth1ok/summary_is_memory_useage_bugged/ that made some good points. It also suggested that you install qemu-guest-agent then enable it on the VM guest options. I've done so and rebooted the VM. Memory Summary metrics looks more in line with what I would expect. I'll give it some time to verify.

HK
 
Last edited:
For Linux Proxmox is reporting RAM usage from the viewpoint of the hypervisor. If your VM got 10GB RAM allocated and 2GB are "used", 7GB are cache/buffer and 1GB is "free", then from the hypervisors perspective 90% of the RAM is used. The guest will tell you that 8GB are "available" but available isn't equal to free. In the end your VM is really using 90% of its RAM and proxmox is showing this. The guest only tells you that 8GB are "available" because it know that it can delete the cache to free up 7GB.

Run free -h inside the guest if you want to know how much RAM the guest is using.
 
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!