-
Notifications
You must be signed in to change notification settings - Fork 18k
runtime: heap target increased by significantly more than GOGC should allow #67592
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
It's hard to tell what's going wrong without a way to reproduce or see what Note that generally, it is possible for the program to overrun the heap goal by at least a little bit. However that overrun is typically visible in the |
I can't share code but I can tell you exactly what I did. I used the go-git library to read Here's the rest of the gctrace output from gc 123. You can see the heap goal continues incrementing by 3% after that one dramatic spike. My computer has 8GiB of RAM and GOMAXPROCS was 4.
|
@seankhliao According to Github, it seems like the WaitingForInfo label was added at the same time as I provided the requested info. |
Given the additional logs, I am skeptical that this is a GC bug. My current hypothesis is that your application is making a single ~500 MiB allocation (or maybe a handful of very large, ~100 MiB allocations concurrently). It does appear that the GC thinks your live heap is actually 856 MiB in size. If this was some kind of strange overrun bug, I would expect the following GC to realize that the vast majority of that memory isn't actually needed and drop it immediately. From that perspective, As a result, I suspect there isn't actually anything actionable here. I'd recommend taking a look at a heap profile (the |
That profile appears to have been taken at the end of program execution, since the |
sounds like gc is working correctly. |
Go version
go version go1.22.0 darwin/amd64
Output of
go env
in your module/workspace:What did you do?
GODEBUG=gctrace=1, gcpacer=1 GOGC=3 ./myprogram
What did you see happen?
the heap target steadily increased by 3 % and then suddenly by more than 100% at gc 122
What did you expect to see?
The heap goal to consistenly increase by 3%
The text was updated successfully, but these errors were encountered: