-
Notifications
You must be signed in to change notification settings - Fork 34
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
why use memory usage to calucate gc percent? #11
Comments
reading from memstats heap is more accurate,but reading from memstats will cause stw,which is harmful reading from proc is also not good,because some app has lots of goroutines,if goroutine stacks cost more memory than heap,we cannot get a proper new valve if you have any good suggestion,im happy to accept |
how about runtime/metrics? metrics like /gc/heap/goal:bytes ? |
runtime/metrics is imported in Go 1.16, I'll consider about it |
now, 1.19.beta provide Soft memory limit |
Yes, https://github.com/golang/proposal/blob/master/design/48409-soft-memory-limit.md, memory ballast and gc tuner will be useless when 1.19 finally released... So I'll keep this lib as it is🤔 |
may be in same case,we can use gc tuner to reduce gc cycle time ? |
I've read the proposal again, GOGC and GOMEMLIMIT will both affect the gc cycle and memory consumption, we need some experiment to know the exact effects... "useless" is a hasty conclusion. |
But I think setting GOGC to off will have a same effect as gc tuner? |
proposal says deal with Death spirals is to place a limit on the amount of total CPU utilization of the garbage collector. If the garbage collector were to execute and exceed that limit at any point, it will instead let the application proceed, even if that means missing its goal and breaching the memory limit. and proposal says they simply pick a reasonable default based on GOGC. may be need to check implement of Soft memory limit to known real behave. |
Based on scavenging policy, go will not return released memory to os immediately, but nextgc use heapMarked, it diff with memory usage
memory usage from /proc/ may be delay, when trigger gc, and may lead gc percent incorrectly.
The text was updated successfully, but these errors were encountered: