-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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: being unable to allocate across scavenged and unscavenged memory leads to fragmentation blow-up in some cases #35848
Comments
/cc @aclements @mknyszek (Please let me know if there are other people who are better to ping about an issue like this.) |
@savalin FWIW, I can't reproduce this at tip. The reason this decision was made in the first place was to accommodate the more aggressive mechanism for returning memory to the OS in Go 1.13 (#30333). The decision was deemed a good idea because jemalloc and other allocators follow a similar rule for returning memory to the OS. It seems like for whatever reason this decision is causing fragmentation which really hurts this application. Anyway, it shouldn't matter for future releases. This bug is effectively fixed for the Go 1.14 release. Please give the tip of the master branch a try and see if you get the same results. Finally, this made me realize that CC @aclements, since this is the first consequence we're seeing of that original decision. Please continue reading if you'd like to see some additional notes I wrote while sussing this out.
|
@savalin I will close this once you're able to verify that this is fixed for you. If you're still experiencing problems, we'll move on from there. |
This comment has been minimized.
This comment has been minimized.
@savalin My mistake. This doesn't reproduce at tip as long as you put a I can get it to increase the same as in #35890. What @randall77 mentioned in that one is pretty much what I'm seeing here: it caps out at around 20 GiB. |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes. Tested on
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Original issue description is posted at gonum library repo gonum/gonum#1174
In a few words: we have a huge graph in memory and we need to update it periodically.
After a new graph initialization, we switch pointer to the new graph and wait for GC to free unused memory.
But it never reuses all the HeapIdle and asks OS for new pages increasing HeapSys infinitely.
Base self-contained demo: https://github.com/savalin/example/blob/master/main.go.
It's simplified code but even this one shows some memory management strangeness.
What did you expect to see?
HeapIdle re-usage instead of asking OS for new memory.
What did you see instead?
HeapIdle/HeapSys grow infinitely (until OMM-killer wake up and kill the app)
Currently, we downgraded golang to v1.11.13 as a workaround, but we hope to be able to use new golang releases
The text was updated successfully, but these errors were encountered: