]> Cypherpunks repositories - gostls13.git/commit
runtime: reset mark state before checkmark and gctrace=2 mark
authorAustin Clements <austin@google.com>
Fri, 26 Jun 2015 17:56:58 +0000 (13:56 -0400)
committerAustin Clements <austin@google.com>
Mon, 29 Jun 2015 15:58:29 +0000 (15:58 +0000)
commit1b917484a892d0f22d26143a21581cb51d509d44
treec9a66c2adf5f8e24ec1b54c119e09d2511605402
parentd57056ba2619ed75a8b1c0255d318ac1dc9a1bb1
runtime: reset mark state before checkmark and gctrace=2 mark

Currently we fail to reset the live heap accounting state before the
checkmark mark and before the gctrace=2 extra mark. As a result, if
either are enabled, at the end of GC it thinks there are 0 bytes of
live heap, which causes the GC controller to initiate a new GC
immediately, regardless of the true heap size.

Fix this by factoring this state reset into a function and calling it
before all three possible marks.

This function should be merged with gcResetGState, but doing so
requires some additional cleanup, so it will wait for after the
freeze. Filed #11427 for this cleanup.

Fixes #10492.

Change-Id: Ibe46348916fc8368fac6f086e142815c970a6f4d
Reviewed-on: https://go-review.googlesource.com/11561
Reviewed-by: Russ Cox <rsc@golang.org>
src/runtime/mgc.go