eve icon indicating copy to clipboard operation
eve copied to clipboard

Ensure Pillar handles OS memory reporting accurately

Open OhmSpectator opened this issue 7 months ago • 0 comments

During tests, @cperakis discovered that EVE OS reports the memory allocated for a VM as still free when using the free tool. This behavior is also observed in /proc/meminfo. This could mean we should not trust what we get from the system as "free" memory. When Pillar requests free memory, it might include memory already allocated for an app, which could pose a problem when deciding on available resources for starting a new VM. This behavior is due to Linux's memory overcommitment, which does not mark the memory as non-free until it is really used.

Currently, as far as I remember we retrieve the "free memory" value by analyzing the MemAvailable line in /proc/meminfo: https://github.com/lf-edge/eve/blob/078f89114f800d20f4245cab76bfee917e09fe39/pkg/pillar/vendor/github.com/shirou/gopsutil/mem/mem_linux.go#L92-L98 https://github.com/lf-edge/eve/blob/397dce609e48b4de56d4839d6aadc98110524239/pkg/pillar/hypervisor/hypervisor.go#L115

The task is to:

  • Verify how this information is used later in Pillar.
  • Ensure that Pillar correctly accounts for app-allocated memory, either by manual accounting in the code or by accurately interpreting the system-reported "free" memory.
  • If it does not interpret it right - fix it.

OhmSpectator avatar Jul 24 '24 13:07 OhmSpectator