-
Notifications
You must be signed in to change notification settings - Fork 18k
runtime: use MADV_REMOVE on Linux #61688
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
Comments
cc @golang/runtime |
thank you |
There is no API change here so taking out of the proposal process. |
I don't think
All the Go runtime's mappings for the heap are private anonymous mappings. This madvise flag seems geared specifically toward memory-mapped files. I'm not sure if this does exactly what you want, but on Linux platforms that don't support |
In triage now, I don't think this is actionable, unless I'm misunderstanding the requirements of |
Starting with Go 1.12, the default configuration utilizes MADV_DONTNEED, but this doesn't guarantee that the operating system will immediately reclaim the memory. In containerized environments where resources are scarce and limits are set relatively low, there's still a high likelihood of running into an Out Of Memory (OOM) situation.
To address this issue, an option can be added to support MADV_REMOVE, allowing the reclaimed memory to be promptly returned to the operating system. This solution is particularly suited to scenarios that are sensitive to memory usage but not as concerned with efficiency.
For more detailed information on this subject, you can refer to the Linux man-pages: Linux man-pages.
The text was updated successfully, but these errors were encountered: