Commit 0db71338 authored by Shenghou Ma's avatar Shenghou Ma

runtime/debug: force GC after setting of GCPercent to make it effective.

See also discussion in CL 51010045.

R=golang-codereviews, r
CC=golang-codereviews
https://golang.org/cl/52230043
parent 71377d3c
......@@ -91,7 +91,9 @@ func (x byDuration) Less(i, j int) bool { return x[i] < x[j] }
// at startup, or 100 if the variable is not set.
// A negative percentage disables garbage collection.
func SetGCPercent(percent int) int {
return setGCPercent(percent)
old := setGCPercent(percent)
runtime.GC()
return old
}
// FreeOSMemory forces a garbage collection followed by an
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment