-
Notifications
You must be signed in to change notification settings - Fork 720
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
Use RTS --disable-delayed-os-memory-return by default for the node #2493
Conversation
By default on Linux the RTS uses a fast method of returning memory to the kernel. This fast method allows the kernel to free the memory lazily when there is memory pressure. The downside of leting the kernel do it lazily is that the RSS measure is also only updated lazily. This has the effect of scaring system admins that the RSS is really high, when in reality that does not reflect the actual amount of memory being used. So by using +RTS --disable-delayed-os-memory-return we ask the RTS to not use the faster freeing method and use the normal method that updates the RSS eagerly.
bors merge |
2493: Use RTS --disable-delayed-os-memory-return by default for the node r=nc6 a=dcoutts By default on Linux the RTS uses a fast method of returning memory to the kernel. This fast method allows the kernel to free the memory lazily when there is memory pressure. The downside of leting the kernel do it lazily is that the RSS measure is also only updated lazily. This has the effect of scaring system admins that the RSS is really high, when in reality that does not reflect the actual amount of memory being used. So by using +RTS --disable-delayed-os-memory-return we ask the RTS to not use the faster freeing method and use the normal method that updates the RSS eagerly. Co-authored-by: Duncan Coutts <duncan@well-typed.com>
For some reason this is failing on I pushed a commit to limit the use of this RTS option to |
@newhoggy Can you approve? Seems like it needs a codeowner |
else | ||
ghc-options: "-with-rtsopts=-T -I0 -N2 -A16m --disable-delayed-os-memory-return" | ||
|
||
if impl(ghc >= 8.10) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But look at what that does. This mean we use no args at all for earlier ghc versions.
I think it might actually work to use multiple -with-rtsopts
like:
ghc-options: "-with-rtsopts=-T -I0 -N1 -A16m"
if arch(arm)
ghc-options: "-with-rtsopts=-N1"
else
ghc-options: "-with-rtsopts=-N2"
if impl(ghc >= 8.10)
ghc-options: "-with-rtsopts=--disable-delayed-os-memory-return"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW, no need to test this in CI, check in any local "hello world" local Haskell program that it works to use multiple -with-rtsopts=
and that they get combined.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated. Thanks!
5d7922d
to
ac5527e
Compare
bors merge |
Build succeeded: |
By default on Linux the RTS uses a fast method of returning memory to
the kernel. This fast method allows the kernel to free the memory
lazily when there is memory pressure. The downside of leting the kernel
do it lazily is that the RSS measure is also only updated lazily.
This has the effect of scaring system admins that the RSS is really
high, when in reality that does not reflect the actual amount of memory
being used.
So by using +RTS --disable-delayed-os-memory-return we ask the RTS to
not use the faster freeing method and use the normal method that updates
the RSS eagerly.