• Austin Clements's avatar
    runtime: assist harder if GC exceeds the estimated marked heap · 170fb100
    Austin Clements authored
    Currently, the GC controller computes the mutator assist ratio at the
    beginning of the cycle by estimating that the marked heap size this
    cycle will be the same as it was the previous cycle. It then uses that
    assist ratio for the rest of the cycle. However, this means that if
    the mutator is quickly growing its reachable heap, the heap size is
    likely to exceed the heap goal and currently there's no additional
    pressure on mutator assists when this happens. For example, 6g (with
    GOMAXPROCS=1) frequently exceeds the goal heap size by ~25% because of
    this.
    
    This change makes GC revise its work estimate and the resulting assist
    ratio every 10ms during the concurrent mark. Instead of
    unconditionally using the marked heap size from the last cycle as an
    estimate for this cycle, it takes the minimum of the previously marked
    heap and the currently marked heap. As a result, as the cycle
    approaches or exceeds its heap goal, this will increase the assist
    ratio to put more pressure on the mutator assist to bring the cycle to
    an end. For 6g, this causes the GC to always finish within 5% and
    often within 1% of its heap goal.
    
    Change-Id: I4333b92ad0878c704964be42c655c38a862b4224
    Reviewed-on: https://go-review.googlesource.com/9070Reviewed-by: 's avatarRick Hudson <rlh@golang.org>
    Run-TryBot: Austin Clements <austin@google.com>
    170fb100
Name
Last commit
Last update
..
archive Loading commit data...
bufio Loading commit data...
builtin Loading commit data...
bytes Loading commit data...
cmd Loading commit data...
compress Loading commit data...
container Loading commit data...
crypto Loading commit data...
database/sql Loading commit data...
debug Loading commit data...
encoding Loading commit data...
errors Loading commit data...
expvar Loading commit data...
flag Loading commit data...
fmt Loading commit data...
go Loading commit data...
hash Loading commit data...
html Loading commit data...
image Loading commit data...
index/suffixarray Loading commit data...
internal Loading commit data...
io Loading commit data...
log Loading commit data...
math Loading commit data...
mime Loading commit data...
net Loading commit data...
os Loading commit data...
path Loading commit data...
reflect Loading commit data...
regexp Loading commit data...
runtime Loading commit data...
sort Loading commit data...
strconv Loading commit data...
strings Loading commit data...
sync Loading commit data...
syscall Loading commit data...
testing Loading commit data...
text Loading commit data...
time Loading commit data...
unicode Loading commit data...
unsafe Loading commit data...
Make.dist Loading commit data...
all.bash Loading commit data...
all.bat Loading commit data...
all.rc Loading commit data...
androidtest.bash Loading commit data...
bootstrap.bash Loading commit data...
clean.bash Loading commit data...
clean.bat Loading commit data...
clean.rc Loading commit data...
iostest.bash Loading commit data...
make.bash Loading commit data...
make.bat Loading commit data...
make.rc Loading commit data...
nacltest.bash Loading commit data...
race.bash Loading commit data...
race.bat Loading commit data...
run.bash Loading commit data...
run.bat Loading commit data...
run.rc Loading commit data...