You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Capture a trace of running the encoding/json tests and then viewing it in go tool trace:
$ go test -trace json.trace encoding/json
(I did this while implementing heap metrics for CL 538515. At first I thought it's a bug in my code, but then I realized the problem exists in the old tracer as well 😅.)
What did you expect to see?
A reasonable NextGC metric value.
What did you see instead?
An unreasonable NextGC metric value. Maybe caused by a uint64 underflow?
As far as I can tell, the problem appears to be in the data, not the trace viewer.
Ugh. I think this might not be a bug, just an artifact of what happens when SetGCPercent(-1) is called. It sets the GC percent goal to defaultHeapMinimum*uint64(-1)/100. The heap goal calculation may then subtract some relatively small number from this, hence why it waffles a little.
I've always disliked this logic. Perhaps it's time to finally fix it.
This also made me realize we definitely do not emit enough HeapGoal events. We only emit one at the start of the trace and when SetGCPercent or SetMemoryLimit is called, AFAICT. We should be emitting one at least once per GC cycle.
Actually, how should we represent setting GOGC=off in the trace viewer? Just picking a high number doesn't seem quite right because they both make the graph look weird. I guess ideally the graph would just not have any data in that region, so maybe that means it should be zero?
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes, including tip.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Capture a trace of running the
encoding/json
tests and then viewing it in go tool trace:(I did this while implementing heap metrics for CL 538515. At first I thought it's a bug in my code, but then I realized the problem exists in the old tracer as well 😅.)
What did you expect to see?
A reasonable NextGC metric value.
What did you see instead?
An unreasonable NextGC metric value. Maybe caused by a
uint64
underflow?As far as I can tell, the problem appears to be in the data, not the trace viewer.
cc @mknyszek @prattmic
The text was updated successfully, but these errors were encountered: