Skip to content
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

runtime/metrics: /memory/classes/heap/unused:bytes spikes [1.22 backport] #67188

Closed
gopherbot opened this issue May 5, 2024 · 3 comments
Closed
Labels
CherryPickApproved Used during the release process for point releases compiler/runtime Issues related to the Go compiler and/or runtime.
Milestone

Comments

@gopherbot
Copy link
Contributor

@mknyszek requested issue #67019 to be considered for backport to the next 1.22 minor release.

@gopherbot Please open backport issues for Go 1.21 and Go 1.22.

This issue can cause spurious overflow in runtime metrics with no workaround.

@gopherbot gopherbot added the CherryPickCandidate Used during the release process for point releases label May 5, 2024
@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label May 5, 2024
@gopherbot gopherbot modified the milestones: Go1.22.3, Go1.22.4 May 5, 2024
@gopherbot
Copy link
Contributor Author

Change https://go.dev/cl/584339 mentions this issue: [relase-branch.go1.22] runtime: update large object stats before freeSpan in sweep

@cagedmantis cagedmantis added the CherryPickApproved Used during the release process for point releases label May 22, 2024
@gopherbot gopherbot removed the CherryPickCandidate Used during the release process for point releases label May 22, 2024
@cagedmantis
Copy link
Contributor

Approved as this is a bug with no workaround.

gopherbot pushed a commit that referenced this issue May 24, 2024
…eSpan in sweep

Currently freeSpan is called before large object stats are updated when
sweeping large objects. This means heapStats.inHeap might get subtracted
before the large object is added to the largeFree field. The end result
is that the /memory/classes/heap/unused:bytes metric, which subtracts
live objects (alloc-free) from inHeap may overflow.

Fix this by always updating the large object stats before calling
freeSpan.

For #67019.
Fixes #67188.

Change-Id: Ib02bd8dcd1cf8cd1bc0110b6141e74f678c10445
Reviewed-on: https://go-review.googlesource.com/c/go/+/583380
Auto-Submit: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Felix Geisendörfer <felix.geisendoerfer@datadoghq.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
(cherry picked from commit 36d32f6)
Reviewed-on: https://go-review.googlesource.com/c/go/+/584339
Reviewed-by: Carlos Amedee <carlos@golang.org>
@gopherbot
Copy link
Contributor Author

Closed by merging 3c96ae0 to release-branch.go1.22.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CherryPickApproved Used during the release process for point releases compiler/runtime Issues related to the Go compiler and/or runtime.
Projects
None yet
Development

No branches or pull requests

2 participants