[SOLVED] Over 60% of RAM usage on idle VM's

JonazThern

Member
Sep 28, 2021
23
1
8
45
Screenshot_9.png

So, I have 2 instances running. 1 with Windows 10, which is not doing anything, and has 8GB assigned and one with Home Assistant, also not doing anything and 4GB of RAM assigned. Something is eating my RAM. Is there any way of checking what can cause this?
 
linuxatemyram.com

And if you are using ZFS its ARC will use up to 50% of your hosts RAM for caching if you don'T manually limit the maximum ARC size. You can run arc_summary to see how much RAM your ARC is using.
 
linuxatemyram.com

And if you are using ZFS its ARC will use up to 50% of your hosts RAM for caching if you don'T manually limit the maximum ARC size. You can run arc_summary to see how much RAM your ARC is using.

Thank you so much, I was actually quite worried for a sec. Then it's proxmox using the RAM, and not the VM's? Asking mostly since I'm learning something new here :)
 
Thank you so much, I was actually quite worried for a sec. Then it's proxmox using the RAM, and not the VM's? Asking mostly since I'm learning something new here :)
Show us the output of your free -h and arc_summary so we can tell if it is caching of your host.
All your guests are caching too, so you shouldn't give your guests more RAM than they actually really need. Lets say you got a VM where system+services usually consume 2-3GB RAM. Then you should give it something like 4GB RAM and not more because the guest will cache until all of its RAM is used. So with 4GB it will cache 1-2 GB of data in RAM and you got 4GB that neither your host nor another VM/LXC may use. If you give that guest 8GB RAM it will use 5-6GB for caching and 8GB can't be used by other guests or the host. So you don't want alot of caching inside your VMs.
 
just to add to this, on any virtualisation, your guest VM will use the ram allocated due to file caching in ram. Every modern OS caches in ram but when you look at the ram usage say htop on the vm, it will report its active usage but not cached, instead look for the Free ram and it will usually be very low. Even with ballooning ram usage will still be high on the host due to OS caching behaviour, and this is why you cannot oversubscribe ram without running into performance issues.

Caching is fine and useful but you will want to size your ram right to make sure everything its going to actively run has enough ram.
 
just to add to this, on any virtualisation, your guest VM will use the ram allocated due to file caching in ram. Every modern OS caches in ram but when you look at the ram usage say htop on the vm, it will report its active usage but not cached, instead look for the Free ram and it will usually be very low. Even with ballooning ram usage will still be high on the host due to OS caching behaviour, and this is why you cannot oversubscribe ram without running into performance issues.

Caching is fine and useful but you will want to size your ram right to make sure everything its going to actively run has enough ram.

Yea, when I look at "Summary", I would prefer to see how much free RAM I have, and not how much is cached. Now I know that 60% is cool, but I would prefer to see "10% used" instead :)
 
Hi, I have been using Proxmox mainly to run Home Assistant as a VM (and a small LXC with very little memory assigned to it).
Lately I have noticed that Home Assistant VM in Proxmox reports the memory use of almost 100% (of the 8GB assigned to the VM) within very few hours.

Captura de Pantalla 2021-12-16 a la(s) 12.12.12.png


If I check the actual memory usage within Home Assistant (guest), it's far from it, showing most of the memory to be available:

Captura de Pantalla 2021-12-16 a la(s) 12.11.22.png


So it seems, as described in previous replies, that Proxmox is using a lot of memory for caching. I tried arc_summary on the host, but I really don't understand the extremely detailed report it gives, what I should be looking for, or if I should limit it and how.
I know Home Assistant does not require so much memory, I increased it some time ago when, I guess by misreading the memory usage, I thought it was running low.
So, should I try to limit the memory arc allocates for cache? decrease the VM's RAM to only the required 4GB?
 
Hi, I have been using Proxmox mainly to run Home Assistant as a VM (and a small LXC with very little memory assigned to it).
Lately I have noticed that Home Assistant VM in Proxmox reports the memory use of almost 100% (of the 8GB assigned to the VM) within very few hours.

View attachment 32444


If I check the actual memory usage within Home Assistant (guest), it's far from it, showing most of the memory to be available:

View attachment 32443


So it seems, as described in previous replies, that Proxmox is using a lot of memory for caching. I tried arc_summary on the host, but I really don't understand the extremely detailed report it gives, what I should be looking for, or if I should limit it and how.
I know Home Assistant does not require so much memory, I increased it some time ago when, I guess by misreading the memory usage, I thought it was running low.
So, should I try to limit the memory arc allocates for cache? decrease the VM's RAM to only the required 4GB?
It isn't the ARC. Its just normal linux pagefile caching. ARC wouldn't be counted as cache/buff.

And the PVE graph is correct. 99% of your physical RAM is used with just 81MB free. But thats no problem because PVE can free up 6.7GB of its used RAM (thats what "available" means) if needed by processes or guests.
 
Last edited:
It isn't the ARC. Its just normal linux pagefile caching. ARC wouldn't be counted as cache/buff.

And the PVE graph is correct. 99% of your physical RAM is used with just 81MB free. But thats no problem because PVE can free up 6.7GB of its used RAM (thats what "available" means) if needed by processes or guests.
Thanks for your reply! I see, really didn't paid much attention to buff/cache on the guest, and was focused on the graph displayed in Proxmox, which gets red and we all know red is bad :P
So, based on your suggestion to another user (above), I shouldn't give the guest more memory than it needs, as the guest will cache all the VM's assigned memory. I guess it's not a problem as long as I don't need that RAM for another VM running on the same node.
thanks!
 
Hi guys,
I noticed same problem for me, I have proxmox with just a VM with Home Assistant inside. I have same ram usage but no ram available if i make the
Code:
free -h
Is it normal? I don't think so at all.
Pics in attachment,
thanks
 

Attachments

  • Schermata 2022-09-28 alle 23.28.00.png
    Schermata 2022-09-28 alle 23.28.00.png
    155.3 KB · Views: 35
  • Schermata 2022-09-28 alle 23.27.46.png
    Schermata 2022-09-28 alle 23.27.46.png
    32.1 KB · Views: 33
Hi guys,
I noticed same problem for me, I have proxmox with just a VM with Home Assistant inside. I have same ram usage but no ram available if i make the
Code:
free -h
Is it normal? I don't think so at all.
Pics in attachment,
thanks
Both Proxmox and free agree: 7.2GiB memory used and 2.5GiB swap used. What's the problem? If you only have 8GiB RAM and 7.2GiB is used, you have very little RAM available.
 
Yes they both agree but I'm asking if it's a normal behaviour or not.
Is it normal to use 95% of the ram while I just run a vm with Home Assistant on it? When I had rpi with 8 gb of ram Home Assistant didn't use neither 2 Gb of Ram.
 
Yes they both agree but I'm asking if it's a normal behaviour or not.
Is it normal to use 95% of the ram while I just run a vm with Home Assistant on it? When I had rpi with 8 gb of ram Home Assistant didn't use neither 2 Gb of Ram.
Every operating system assumes that unused memory is wasted and will fill it with filesystem cache: see Linux ate my RAM which was already suggested by the first reply to your question.. You assigned 7.8GiB of memory to the VM and it uses 1GiB for programs and 6.6GiB for filesystem cache, That's 7.6GiB of memory used according to Proxmox, which does not know that most of it can be reused by the VM (and it is correct because Proxmox cannot reused that memory).
If you don't use PCI(e) passthrough, then you can use ballooning, which tries to keep the host memory usage at 80%. Try 1.5GiB of minimum memory and 6GiB of (maximum) memory for the VM, which allows the VM to use lots of cache for the filesystem but it will reduce it when the Proxmox host needs memory for other stuff (like other VMs).
Note that Proxmox is not designed for running a single VM with all the resources of the host. It's optimized for enterprises running lots of (similar) VMs.
 
Last edited:
You didn't showed us how much RAM you gave that Homeassistant VM/LXC. And you didn't told us if you are using ZFS.
 
Yes they both agree but I'm asking if it's a normal behaviour or not.
Is it normal to use 95% of the ram while I just run a vm with Home Assistant on it? When I had rpi with 8 gb of ram Home Assistant didn't use neither 2 Gb of Ram.

  1. How much memory did you gave that VM?
  2. What does the VM-config (qm config YourVMID) look like?
  3. Guest-agent installed, enabled and running inside the VM?
  4. Output of: free -h inside the VM, if it is linux?

BTW: See here: [1] how to update your PVE.

[1] https://forum.proxmox.com/threads/im-unable-to-upload-files-to-my-proxmox-server.114541/#post-495356
 
But that post is by another person. genga91 just revived the old thread by babelhoo. Maybe he is using different VM settings.
 
  • Like
Reactions: leesteken

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!