Memory for VM/CT

Witker

Active Member
Dec 3, 2020
126
6
38
Germany
Hi

I have 16 GB memory on my server

How much to give the VMs /CTs

Can I give each the full 16 GB ?

Will ProxMox handle the needed Memory ?

Meaning if e.g.
1st VM is not in action but online - it will not need much memory.
2nd VM is in action - will need more memory
Will the memory be put to the 2nd VM in action? And vice versa?

If both are in action will ProxMox split the memory between this 2 VMs?

Hope is clear what I mean!?;)
 
Hi,

What you describe is called "memory overcommitting" and is certainly something that can be done for the reason you describe (not all VM active at the same time). However, it does have some risk: Mainly, the memory can only be used by one process at any time (the VMs are also processes on the host server). If your processes are idle, their reserved memory can automatically be saved to disk temporarily (swapping) and reloaded when they become active - this will give a delay to reactivate them but for the rest, not really a problem. However, if the total memory demanded by the active processes is more than the amount of physical memory, then the server will start to swap violently (disk thrashing) and everything will be really slow or even appear to be frozen completely.

When you create your VM, you can configure "Memory" and "Minimum memory" (check Advanced). I suggest to configure the minimum memory as low as possible depending on which OS runs in the guest VM. Maybe 4GB or less in your case. The (maximum) memory can be much higher but I would still suggest to allocate less than the full amount of physical memory on your server, maybe 12GB-14GB in your case. You will have to experiment to see what works best for you. You can always change these configurations but you will have to shut down your VM and restart it before the change becomes effective.

For containers, it is a bit different. You do not have the possibility to specify a minimum memory. I would still recommend to configure less than the 16GB physical memory you have.

Hope that helps,
Barius