-
Notifications
You must be signed in to change notification settings - Fork 18k
Documentation: some math in the Garbage Collection guide is incorrect #67283
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
Those numbers are the amount of new memory, a.k.a. the |
Your sentence ("those numbers") is a little bit vague. What numbers exactly? I ask that because you only quote part of the equation in question. Did you deliberately omit the first "Live heap" from the equation?
Either way, I think I disagree with you, because the math is correct for one of the three equations. Your remark seems to imply that I misunderstand the whole principle of the equation. However, if, as you seem to suggest, I misunderstood the terminology (and all the math was in fact correct), then how is it possible that I report one of the three equations as correct? Can you clarify? |
It clearly says that 18 is total and others are new. |
The three numbers are
which match your numbers minus 8. I don't see an issue here. Closing. Thanks. |
Go version
1.22
Output of
go env
in your module/workspace:What did you do?
I double checked the math in this blog post about the garbage collector and it seems incorrect. https://tip.golang.org/doc/gc-guide
What did you see happen?
I see two out of three equations in the paragraph as being incorrect.
Correct
*8 + (8+1+1)100/100 = 18
**Incorrect
8 + (8+1+1)*200/100 = 20
8 + (8+1+1)50/100 = 5*
What did you expect to see?
I attached some screenshots from the online calculator. When GOGC is 50, with the given numbers, the expected total should be 13 MiB (not 5). When GOGC is 200, with the given numbers, the expected total should be 28 MiB (not 20).
The text was updated successfully, but these errors were encountered: