• Austin Clements's avatar
    runtime: track heap bytes marked by GC · 50a66562
    Austin Clements authored
    This tracks the number of heap bytes marked by a GC cycle. We'll use
    this information to precisely trigger the next GC cycle.
    
    Currently this aggregates the work counter in gcWork and dispose
    atomically aggregates this into a global work counter. dispose happens
    relatively infrequently, so the contention on the global counter
    should be low. If this turns out to be an issue, we can reduce the
    number of disposes, and if it's still a problem, we can switch to
    per-P counters.
    
    Change-Id: I1bc377cb2e802ef61c2968602b63146d52e7f5db
    Reviewed-on: https://go-review.googlesource.com/8388Reviewed-by: 's avatarRuss Cox <rsc@golang.org>
    50a66562
mgcmark.go 19.3 KB