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: document gctrace output in relation to MemStats #46846

Closed
JohnRusk opened this issue Jun 21, 2021 · 5 comments
Closed

runtime: document gctrace output in relation to MemStats #46846

JohnRusk opened this issue Jun 21, 2021 · 5 comments
Assignees
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. Documentation NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@JohnRusk
Copy link

How do the heap sizes output by gctrace map to the various values of MemStats? I assume that the heap values from gctrace roughly match one (or two?) of the MemStats fields, but I can't find anything that documents that.

I see in the code that the gctrace outputs are mostly based on heap_live and the MemStats values are not (directly) based on the the same thing... but I'm guessing there's an indirect or approximate link. Knowing such a mapping would help a lot in using gctrace, since it doesn't have heaps of documentation but MemStats has lots.

@seankhliao
Copy link
Member

Unlike many projects, the Go project does not use GitHub Issues for general discussion or asking questions. GitHub Issues are used for tracking bugs and proposals only.

For questions please refer to https://github.com/golang/go/wiki/Questions

@JohnRusk
Copy link
Author

@seankhliao In that case, please re-open this as a documentation bug. It should be documented.

@seankhliao seankhliao changed the title gctrace vs MemStats mapping of fields runtime: document gctrace output in relation to MemStats Jun 21, 2021
@seankhliao seankhliao added Documentation NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Jun 21, 2021
@seankhliao
Copy link
Member

cc @aclements @randall77 @mknyszek @prattmic

@seankhliao seankhliao reopened this Jun 21, 2021
@ianlancetaylor ianlancetaylor added this to the Backlog milestone Jun 21, 2021
@mknyszek mknyszek self-assigned this Jun 22, 2021
@mknyszek
Copy link
Contributor

I'm hoping to do something around documentation of how the GC views memory and the heap in the 1.18, so I've assigned it to myself. I'll leave it in the backlog just in case, but it's on my radar.

@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Jul 7, 2022
@mknyszek mknyszek modified the milestones: Backlog, Go1.21 Jun 16, 2023
@gopherbot
Copy link

Change https://go.dev/cl/504115 mentions this issue: runtime: relate GODEBUG=gctrace output to runtime/metrics

@dmitshur dmitshur added NeedsFix The path to resolution is known, but the work has not been done. and removed NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Jun 19, 2023
bradfitz pushed a commit to tailscale/go that referenced this issue Jul 15, 2023
There's more I could list here, but the mapping becomes more complicated
and more fragile. I think this is sufficient to start with.

Fixes golang#46846.

Change-Id: I6803486a64888b2f38e244b8e2175ad064d648ed
Reviewed-on: https://go-review.googlesource.com/c/go/+/504115
Reviewed-by: Michael Pratt <mpratt@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Michael Knyszek <mknyszek@google.com>
Auto-Submit: Michael Knyszek <mknyszek@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. Documentation NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

6 participants