]> Cypherpunks repositories - gostls13.git/commit
runtime: always give concurrent sweep some heap distance
authorAustin Clements <austin@google.com>
Mon, 3 Aug 2015 13:25:23 +0000 (09:25 -0400)
committerAustin Clements <austin@google.com>
Tue, 4 Aug 2015 18:54:41 +0000 (18:54 +0000)
commite30c6d64bac1b5a31a7062dff89744332bebc23e
tree15f062d0daa110781b4e090b78801d0451a14653
parentfb5230af8a0d416fa69049f71eb1271c053e7b8c
runtime: always give concurrent sweep some heap distance

Currently it's possible for the next_gc heap size trigger computed for
the next GC cycle to be less than the current allocated heap size.
This means the next cycle will start immediately, which means there's
no time to perform the concurrent sweep between GC cycles. This places
responsibility for finishing the sweep on GC itself, which delays GC
start-up and hence delays mutator assist.

Fix this by ensuring that next_gc is always at least a little higher
than the allocated heap size, so we won't trigger the next cycle
instantly.

Updates #11911.

Change-Id: I74f0b887bf187518d5fedffc7989817cbcf30592
Reviewed-on: https://go-review.googlesource.com/13043
Reviewed-by: Rick Hudson <rlh@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
src/runtime/mgc.go