aboutsummaryrefslogtreecommitdiffstats
path: root/internal/debug/api.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2017-09-11 18:34:34 +0800
committerGitHub <noreply@github.com>2017-09-11 18:34:34 +0800
commit794741b8b2892adfd763c8895faeb63293b91c3a (patch)
tree178c8a20d4942cf868ac4ba0f335d216fd16afc9 /internal/debug/api.go
parent10b3f97c9dcc6f3711aa2d3b1bb43e67eb921223 (diff)
parent48705f8aea04dffb7e772784122aa600bbc60cab (diff)
downloaddexon-794741b8b2892adfd763c8895faeb63293b91c3a.tar
dexon-794741b8b2892adfd763c8895faeb63293b91c3a.tar.gz
dexon-794741b8b2892adfd763c8895faeb63293b91c3a.tar.bz2
dexon-794741b8b2892adfd763c8895faeb63293b91c3a.tar.lz
dexon-794741b8b2892adfd763c8895faeb63293b91c3a.tar.xz
dexon-794741b8b2892adfd763c8895faeb63293b91c3a.tar.zst
dexon-794741b8b2892adfd763c8895faeb63293b91c3a.zip
Merge pull request #15124 from fjl/debug-gcpercent
internal/debug: add debug_setGCPercent
Diffstat (limited to 'internal/debug/api.go')
-rw-r--r--internal/debug/api.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/internal/debug/api.go b/internal/debug/api.go
index 7583878ed..3547b0564 100644
--- a/internal/debug/api.go
+++ b/internal/debug/api.go
@@ -181,6 +181,12 @@ func (*HandlerT) FreeOSMemory() {
debug.FreeOSMemory()
}
+// SetGCPercent sets the garbage collection target percentage. It returns the previous
+// setting. A negative value disables GC.
+func (*HandlerT) SetGCPercent(v int) int {
+ return debug.SetGCPercent(v)
+}
+
func writeProfile(name, file string) error {
p := pprof.Lookup(name)
log.Info("Writing profile records", "count", p.Count(), "type", name, "dump", file)