Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure Pillar handles OS memory reporting accurately #4104

Open
OhmSpectator opened this issue Jul 24, 2024 · 0 comments
Open

Ensure Pillar handles OS memory reporting accurately #4104

OhmSpectator opened this issue Jul 24, 2024 · 0 comments

Comments

@OhmSpectator
Copy link
Member

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:

case "MemAvailable":
t, err := strconv.ParseUint(value, 10, 64)
if err != nil {
return ret, retEx, err
}
memavail = true
ret.Available = t * 1024

hm.FreeMemoryMB = roundFromBytesToMbytes(vm.Available)

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant