]> Cypherpunks repositories - gostls13.git/commit
runtime: update triggerRatio in setGCPercent
authorAustin Clements <austin@google.com>
Mon, 14 Dec 2015 20:38:12 +0000 (15:38 -0500)
committerAustin Clements <austin@google.com>
Tue, 15 Dec 2015 17:58:38 +0000 (17:58 +0000)
commit2bacae815b853522d8f6bbd82156f1e1c20482cb
tree7e2bf16b5f30b5df0fb1c189e0e632fd69c4c367
parent1e1ea66991ce840d6f52cb8385e23624f16e9f01
runtime: update triggerRatio in setGCPercent

Currently, runtime/debug.SetGCPercent does not adjust the controller
trigger ratio. As a result, runtime reductions of GOGC don't take full
effect until after one more concurrent cycle has happened, which
adjusts the trigger ratio to account for the new gcpercent.

Fix this by lowering the trigger ratio if necessary in setGCPercent.

Change-Id: I4d23e0c58d91939b86ac60fa5d53ef91d0d89e0c
Reviewed-on: https://go-review.googlesource.com/17813
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
src/runtime/mgc.go