]> Cypherpunks repositories - gostls13.git/commit
runtime: track heap bytes marked by GC
authorAustin Clements <austin@google.com>
Thu, 12 Mar 2015 20:53:57 +0000 (16:53 -0400)
committerAustin Clements <austin@google.com>
Mon, 6 Apr 2015 21:28:07 +0000 (21:28 +0000)
commit50a66562a067504c9a21a0ccc00f209ac78166ca
tree0a7c1e2e990faebd652d6f48144421d9d1870315
parentdfc9e264d18a3f9fe7afdb794d227473ce486516
runtime: track heap bytes marked by GC

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/8388
Reviewed-by: Russ Cox <rsc@golang.org>
src/runtime/malloc.go
src/runtime/mgc.go
src/runtime/mgcmark.go
src/runtime/mgcwork.go