PVE node RAM consumption

In case somebody asks, lazy allocation is usually a win. Lots of programs (talking regular programs here) allocate a lot more RAM than they ever use. Java apps are notorious for this but it is really quite common. And it makes sense a lot of the time. Programs usually allocate lots of small blocks. It is more efficient to ask for a big block and parse it out as needed. But that does mean that a certain amount of that big block is never used.
 
  • Like
Reactions: Johannes S and UdoB
In case somebody asks, lazy allocation is usually a win. Lots of programs (talking regular programs here) allocate a lot more RAM than they ever use. Java apps are notorious for this but it is really quite common. And it makes sense a lot of the time. Programs usually allocate lots of small blocks. It is more efficient to ask for a big block and parse it out as needed. But that does mean that a certain amount of that big block is never used.
Thank you. And how it is related to Proxmox reporting in node Search tab a VM using less host memory than actually is?
 
Thank you. And how it is related to Proxmox reporting in node Search tab a VM using less host memory than actually is?
I didn't write the PVE GUI and so don't know where which numbers come from. But it is presumably because that VM hasn't needed to use some of the memory yet and so it is "free" according to the metric that PVE uses.

There are constantly people here asking for the "real" memory usage to be displayed. By this they almost always mean what "free" shows in the "available" column inside the VM. But memory that is used as disk cache is only "available" to the VM. The OS can always discard a cache page since the data is available on disk if it is needed. The hypervisor can't do this since it can't know what a page is used for (at least not without help from something like the balloon driver).

So the output of "free" is a relevant metric for tuning the memory allocation to that VM, but it can't really be used to know how many VM's you can start.