]> Cypherpunks repositories - gostls13.git/commit
runtime: proportional response GC trigger controller
authorAustin Clements <austin@google.com>
Tue, 24 Mar 2015 14:45:20 +0000 (10:45 -0400)
committerAustin Clements <austin@google.com>
Tue, 21 Apr 2015 15:35:37 +0000 (15:35 +0000)
commita0452a68211c505596d0a406ec083cf5d3b03b89
tree9feff136d01e43aae72abb54462a109d67fddfde
parent8d03acce544a2301eecec83a88396e568f4c8c75
runtime: proportional response GC trigger controller

Currently, concurrent GC triggers at a fixed 7/8*GOGC heap growth. For
mutators that allocate slowly, this means GC will trigger too early
and run too often, wasting CPU time on GC. For mutators that allocate
quickly, this means GC will trigger too late, causing the program to
exceed the GOGC heap growth goal and/or to exceed CPU goals because of
a high mutator assist ratio.

This change adds a feedback control loop to dynamically adjust the GC
trigger from cycle to cycle. By monitoring the heap growth and GC CPU
utilization from cycle to cycle, this adjusts the Go garbage collector
to target the GOGC heap growth goal and the 25% CPU utilization goal.

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