Dynamic memory reallocation

skello

New Member
Jan 23, 2018
2
0
1
42
Hello,

I have a question regarding dynamic memory allocation to virtual machines, because I have a situation where it looks like memory is not automatically freed to be reused by the host.

I'm running PVE 5.1-43 with all updates and latest kernel (no subscription).
I have a virtual machine running OpenMediaVault 3 (based on Debian Jessie) running PVE kernel 4.4.98-4-pve. I have dynamic memory allocation for the VM with a minimum of 1024MB and maximum of 4096MB. After a few days of use, PVE shows memory usage for the VM of over 90%, for example, 3.66 GiB. However, inside the VM itself, memory usage is around 7% of 3.85GiB.

Is this normal behavior? Shouldn't memory dynamically scale back when not used by the VM and become available to the host? I've attached screenshots.

Screen Shot 2018-01-23 at 11.46.58.png Screen Shot 2018-01-23 at 11.48.43.png Screen Shot 2018-01-23 at 12.10.52.png
 
this depends on how omv calculates the ram usage (e.g. does it count cache/buffers?)

the dynamic memory will only be reduced if the memory pressure on the host is high -> as long as the host has enough memory, it does not try to reduce the guest memory
 
this depends on how omv calculates the ram usage (e.g. does it count cache/buffers?)

the dynamic memory will only be reduced if the memory pressure on the host is high -> as long as the host has enough memory, it does not try to reduce the guest memory

Thanks for clarifying that. The info about dynamic memory being reduced only if the host is running out of memory is new to me and might be what's going on here. The host still has sufficient memory. I guess I could try to set the maximum limit lower and see if that's a bottleneck for OMV. I've run it for a while with 2GB of RAM instead of 4GB and didn't seem to have a problem. I don't have a lot of stuff running inside, nor RAID or ZFS or anything like that that would require large amounts of RAM. Will give that a try and check out the OMV performance stats over a longer period of time. Thanks.

Also, I think you are right that in that real-time graph OMV does not account for page cache, which is much more evident in the following graph. This also includes the period where only 2GB RAM were assigned to the VM and it coped well.

Screen Shot 2018-01-23 at 15.00.49.png