RAM Usage Doesn't Add Up

TheFuzzyFish

Member
Feb 20, 2018
17
0
6
26
I've had my Proxmox server for a good few months, and I have a handful (about 6 running 24/7) of full VMs with various hardware stats. Most just have a 1 core processor with 1 or 2 gigabytes of allocated RAM.

I noticed today that my RAM usage was higher than normal, about 6.8GB (as reported by top and the PVE web interface). However, looking through my 6 virtual machines, their RAM usage only adds up to about 2.4GB (as reported by the PVE web interface).

Odd, I thought. Using htop (an adapted form of top that has nicely-formatted and colored output), I noticed that each VM had multiple threads, even the 1-core VMs. This kinda made sense; I just figured that Proxmox was making use of multiple cores, which was fine. I thought that, maybe each thread had its own set of the VM's RAM that was mirrored because my server has a NUMA architecture.
I was, however, mistaken. In adding up each VM's RAM usage multiplied by their respective core count, I got a usage of 9.7GB, which is nearly 3GB over what the PVE web interface was showing for my node.

The Proxmox node itself is running the bare-bones installation, with the only extra software installed being htop and an nginx reverse proxy, so it's not using much RAM at all. With all the VMs shut down, the PVE web interface reports just 1.1GB of RAM usage, which still doesn't add up.

I can't get this math to work out. Where is all this RAM going? I don't mind too much, since I definitely have wiggle room on my server with 24GB of RAM, but I'm here because I want to learn. Do I have a fundamental misunderstanding somewhere?
 
Oh, I think it should also be noted that my Proxmox installation is formatted with ext4/lvm, so I don't have the RAM usage of ZFS. Very little of my disk is cached (which if I understand correctly wouldn't even contribute to what is considered "occupied" memory). All of my VMs are configured with a fixed memory size and ballooning.