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

runtime: provide way to disable MADV_FREE #28466

aclements opened this Issue Oct 29, 2018 · 1 comment


None yet
1 participant

aclements commented Oct 29, 2018

CL 135395 switched from MADV_DONTNEED to MADV_FREE for releasing physical memory on Linux. MADV_FREE has many performance advantages, but seems to have one downside: because it releases pages lazily, it doesn't reduce a process's RSS until the system is actually under memory pressure.

I'm concerned that this may be confusing to users, but more concerned that this may confuse automated systems that monitor RSS and/or container memory usage, particularly if those systems make decisions based on this.

We may want to provide a GODEBUG setting to fall back to MADV_DONTNEED. This will give us/users a low-overhead way to confirm if this is causing a user issue as well as a workaround if it is. And then we can collect information on problems caused by this. If they're minor, we can take this GODEBUG out in the future. If they're major, we can roll this back.

/cc @mknyszek @RLH

@aclements aclements added this to the Go1.12 milestone Oct 29, 2018


This comment has been minimized.


aclements commented Oct 29, 2018

As a way to experiment with MADV_DONTNEED and MADV_FREE, I created a test program.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment