runtime: gcControllerState.heapLive from mgcpacer.go inconsistent with gc-guide's Live Heap #65195
Labels
compiler/runtime
Issues related to the Go compiler and/or runtime.
Milestone
Go version
go version devel go1.22-8db131082d Thu Jan 4 23:31:17 2024 +0000 darwin/amd64
Output of
go env
in your module/workspace:What did you do?
I'm looking at https://tip.golang.org/doc/gc-guide, trying to find the parameter to tune the appropriate memory limit. One interesting value is "Live Heap" from this graph.

My understanding is "Live Heap" represents the left heap memory after each GC cycle (after sweep phase, and remain the same as time goes), i.e, the marked memory after each GC (provided GCPercent not changed). This is consistent with this issue #56857, which takes
heapMarked
asLive Heap
value.However, there's a specific field
heapLive
, along withheapMarked
heapLive
from abovegcControllerState
context actually grows as new allocate happens, and in most timeheapLive
>heapMarked
. After GC Mark phase work done,heapLive
=heapMarked
. This is a bit confusing for the two terminologiesheapLive
andLive Heap
.What did you see happen?
heapLive
andLive Heap
are very closed naming, but mean something quite different across code and documentation.What did you expect to see?
Either
heapLive
orLive Heap
gets updated to a better name. At this moment, updatingLive heap
seems more appropriate IMO, maybeMarked Heap
^?/gc/heap/live:bytes could probably be renamed to
/gc/heap/marked:bytes
.The text was updated successfully, but these errors were encountered: