How Proxmox manage memory?

francisco.

Member
Sep 8, 2014
36
0
6
Madrid
Hi,

can someone explain me how Proxmox manage RAM memory? For example:


Proxmox has 20VM with 1GB ram everyone. If Proxmox has 30 GB RAM, memory free 10GB?


I ask it cause memory static vs dynamic memory for VM.

Regards.
 
Last edited:
Hi Fransisco,

Its not that evident how much memory will be free. Proxmox VE (Linux Kernel) has several very nice features which can save memory, as well as dynamic filesystem caching which will show up as 'cache' and thus 'used' memory.

Having 20 VMs with 1 GB each, will result in more than 50% used memory, which will trigger the 'KSM' daemon to look for memory pages that are the same in multiple VMs.
KSM = 'Kernel Shared Pages' which is basically a memory 'deduplication' daemon, which will look in memory for memory pages that contain the same data, if these are found (like 20 VMs with the same version of Windows (or Linux) ) then KSM will keep 1 page in memory and make 20 pointers to the same page, freeing 19 memory pages.
However, the Linux kernel also uses free memory for caching accesses to the disks, which looks like 'used' memory.
This means, the actual memory usage is not exactly calculable.
 
Hi Fransisco,

Its not that evident how much memory will be free. Proxmox VE (Linux Kernel) has several very nice features which can save memory, as well as dynamic filesystem caching which will show up as 'cache' and thus 'used' memory.

Having 20 VMs with 1 GB each, will result in more than 50% used memory, which will trigger the 'KSM' daemon to look for memory pages that are the same in multiple VMs.
KSM = 'Kernel Shared Pages' which is basically a memory 'deduplication' daemon, which will look in memory for memory pages that contain the same data, if these are found (like 20 VMs with the same version of Windows (or Linux) ) then KSM will keep 1 page in memory and make 20 pointers to the same page, freeing 19 memory pages.
However, the Linux kernel also uses free memory for caching accesses to the disks, which looks like 'used' memory.
This means, the actual memory usage is not exactly calculable.

Thank you for you reply.

Then, when is it advisable set "automatically allocate memory" vs "fixed size memory"?
 
As far as I know, this does not have a direct consequence for the KSM and caching, but, should the machine be 'in need' of free memory, setting to dynamic enables the 'balloon' driver which should be installed seperately in Windows, (virtio-drivers pack).
This allows the VM to free up unused memory within the VM to the host OS.
I'm not sure what this can have an effect within the VM during high usage in the VM as well ....

Thus, setting this to a dynamic value can allow you to run even more VMs than you have physical memory for, however, overcommitting memory like this. can possibly cause performance issues...
Your milage may vary ......
 

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!