• Austin Clements's avatar
    runtime: proportional mutator assist · 4b2fde94
    Austin Clements authored
    Currently, mutator allocation periodically assists the garbage
    collector by performing a small, fixed amount of scanning work.
    However, to control heap growth, mutators need to perform scanning
    work *proportional* to their allocation rate.
    
    This change implements proportional mutator assists. This uses the
    scan work estimate computed by the garbage collector at the beginning
    of each cycle to compute how much scan work must be performed per
    allocation byte to complete the estimated scan work by the time the
    heap reaches the goal size. When allocation triggers an assist, it
    uses this ratio and the amount allocated since the last assist to
    compute the assist work, then attempts to steal as much of this work
    as possible from the background collector's credit, and then performs
    any remaining scan work itself.
    
    Change-Id: I98b2078147a60d01d6228b99afd414ef857e4fba
    Reviewed-on: https://go-review.googlesource.com/8836Reviewed-by: default avatarRick Hudson <rlh@golang.org>
    4b2fde94
runtime2.go 20.8 KB