]> Cypherpunks repositories - gostls13.git/commit
runtime: report next_gc for initial heap size in gctrace
authorAustin Clements <austin@google.com>
Sat, 4 Apr 2015 16:27:46 +0000 (12:27 -0400)
committerAustin Clements <austin@google.com>
Thu, 9 Apr 2015 22:18:06 +0000 (22:18 +0000)
commitcb10ff1ef9a9d1606e652573c1add5b698da7b25
treed0054e62095937e43631bd4690aad9a0b171ea2e
parentd13f479de37264a738e430e15f6c626ad3fac672
runtime: report next_gc for initial heap size in gctrace

Currently, the initial heap size reported in the gctrace line is the
heap_live right before sweep termination. However, we triggered GC
when heap_live reached next_gc, and there may have been significant
allocation between that point and the beginning of sweep
termination. Ideally these would be essentially the same, but
currently there's scheduler delay when readying the GC goroutine as
well as delay from background sweep finalization.

We should fix this delay, but in the mean time, to give the user a
better idea of how much the heap grew during the whole of garbage
collection, report the trigger rather than what the heap size happened
to be after the garbage collector finished rolling out of bed. This
will also be more useful for heap growth plots.

Change-Id: I08476b9fbcfb2de90592405e9c9f434dfb9eb1f8
Reviewed-on: https://go-review.googlesource.com/8512
Reviewed-by: Rick Hudson <rlh@golang.org>
src/runtime/mgc.go