aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAustin Clements <austin@google.com>2015-08-03 17:45:44 -0400
committerAustin Clements <austin@google.com>2015-08-04 18:54:46 +0000
commitf9dc3382ad8b3ec330b41297053e14dd199d3b5f (patch)
treecdbdc33f3219fbc86eb94e1c4b07034b8b9bab21
parentfc9ca85f4c4d38ee60b92f79544274c6019e8c5b (diff)
downloadgo-f9dc3382ad8b3ec330b41297053e14dd199d3b5f.tar.gz
go-f9dc3382ad8b3ec330b41297053e14dd199d3b5f.zip
runtime: when gcpacertrace > 0, print information about assist ratio
This was useful in debugging the mutator assist behavior for #11911, and it fits with the other gcpacertrace output. Change-Id: I1e25590bb4098223a160de796578bd11086309c7 Reviewed-on: https://go-review.googlesource.com/13046 Reviewed-by: Rick Hudson <rlh@golang.org> Reviewed-by: Russ Cox <rsc@golang.org>
-rw-r--r--src/runtime/mgc.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/runtime/mgc.go b/src/runtime/mgc.go
index c50d68e432..b1fbdc91bb 100644
--- a/src/runtime/mgc.go
+++ b/src/runtime/mgc.go
@@ -441,6 +441,15 @@ func (c *gcControllerState) startCycle() {
// throughout the cycle.
c.revise()
+ if debug.gcpacertrace > 0 {
+ print("pacer: assist ratio=", c.assistRatio,
+ " (scan ", memstats.heap_scan>>20, " MB in ",
+ work.initialHeapLive>>20, "->",
+ c.heapGoal>>20, " MB)",
+ " workers=", c.dedicatedMarkWorkersNeeded,
+ "+", c.fractionalMarkWorkersNeeded, "\n")
+ }
+
// Set up a timer to revise periodically
c.reviseTimer.f = func(interface{}, uintptr) {
gcController.revise()