]> Cypherpunks repositories - gostls13.git/commit
runtime: fix MemStats.{PauseNS,PauseEnd,PauseTotalNS,LastGC}
authorAustin Clements <austin@google.com>
Wed, 1 Jul 2015 15:04:19 +0000 (11:04 -0400)
committerAustin Clements <austin@google.com>
Mon, 13 Jul 2015 23:32:59 +0000 (23:32 +0000)
commit777ab5ce1a47bc7cc71e6a675c2dcc76e69e11d5
tree5a606e800e4c1cccb7764c9fc2f59baab0f6c445
parentad60cd8b929553611c30b01b0f39164acc91473f
runtime: fix MemStats.{PauseNS,PauseEnd,PauseTotalNS,LastGC}

These memstats are currently being computed by gcMark, which was
appropriate in Go 1.4, but gcMark is now just one part of a bigger
picture. In particular, it can't account for the sweep termination
pause time, it can't account for all of the mark termination pause
time, and the reported "pause end" and "last GC" times will be
slightly earlier than they really are.

Lift computing of these statistics into func gc, which has the
appropriate visibility into the process to compute them correctly.

Fixes one of the issues in #10323. This does not add new statistics
appropriate to the concurrent collector; it simply fixes existing
statistics that are being misreported.

Change-Id: I670cb16594a8641f6b27acf4472db15b6e8e086e
Reviewed-on: https://go-review.googlesource.com/11794
Reviewed-by: Russ Cox <rsc@golang.org>
src/runtime/malloc_test.go
src/runtime/mgc.go