• Austin Clements's avatar
    runtime: reset mark state before checkmark and gctrace=2 mark · 1b917484
    Austin Clements authored
    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/11561Reviewed-by: 's avatarRuss Cox <rsc@golang.org>
    1b917484
mgc.go 54.6 KB