mirror of
https://github.com/golang/go
synced 2024-11-18 11:44:45 -07:00
runtime: explain why continuous assist revising is necessary
Change-Id: I950af8d80433b3ae8a1da0aa7a8d2d0b295dd313 Reviewed-on: https://go-review.googlesource.com/15404 Reviewed-by: Rick Hudson <rlh@golang.org>
This commit is contained in:
parent
3271250ec4
commit
39ed682206
@ -445,9 +445,16 @@ func (c *gcControllerState) startCycle() {
|
|||||||
// improved estimates. This should be called either under STW or
|
// improved estimates. This should be called either under STW or
|
||||||
// whenever memstats.heap_scan is updated (with mheap_.lock held).
|
// whenever memstats.heap_scan is updated (with mheap_.lock held).
|
||||||
func (c *gcControllerState) revise() {
|
func (c *gcControllerState) revise() {
|
||||||
// Compute the expected scan work. This is a strict upper
|
// Compute the expected scan work.
|
||||||
// bound on the possible scan work in the current heap.
|
|
||||||
//
|
//
|
||||||
|
// Note that the scannable heap size is likely to increase
|
||||||
|
// during the GC cycle. This is why it's important to revise
|
||||||
|
// the assist ratio throughout the cycle: if the scannable
|
||||||
|
// heap size increases, the assist ratio based on the initial
|
||||||
|
// scannable heap size may target too little scan work.
|
||||||
|
//
|
||||||
|
// This particular estimate is a strict upper bound on the
|
||||||
|
// possible scan work in the current heap.
|
||||||
// You might consider dividing this by 2 (or by
|
// You might consider dividing this by 2 (or by
|
||||||
// (100+GOGC)/100) to counter this over-estimation, but
|
// (100+GOGC)/100) to counter this over-estimation, but
|
||||||
// benchmarks show that this has almost no effect on mean
|
// benchmarks show that this has almost no effect on mean
|
||||||
|
Loading…
Reference in New Issue
Block a user