Navigation Menu

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

runtime: provide way to disable MADV_FREE #28466

Closed
aclements opened this issue Oct 29, 2018 · 3 comments
Closed

runtime: provide way to disable MADV_FREE #28466

aclements opened this issue Oct 29, 2018 · 3 comments

Comments

@aclements
Copy link
Member

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
@aclements
Copy link
Member Author

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

@gopherbot
Copy link

Change https://golang.org/cl/155931 mentions this issue: runtime: add GODEBUG=madvdontneed=1

@gopherbot
Copy link

Change https://golang.org/cl/155929 mentions this issue: doc/go1.12: mention Conn.SetDeadline improvements, GODEBUG=madvdontneed=1

gopherbot pushed a commit that referenced this issue Jan 4, 2019
…ed=1

Fixes #29439
Updates #28466

Change-Id: Ifa0779a089a969f99f1a47127e23565f31eec24f
Reviewed-on: https://go-review.googlesource.com/c/155929
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
@golang golang locked and limited conversation to collaborators Jan 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants