aboutsummaryrefslogtreecommitdiffstats
path: root/internal/debug
diff options
context:
space:
mode:
authorFelix Lange <fjl@twurst.com>2017-09-11 18:29:47 +0800
committerFelix Lange <fjl@twurst.com>2017-09-11 18:29:47 +0800
commit48705f8aea04dffb7e772784122aa600bbc60cab (patch)
tree178c8a20d4942cf868ac4ba0f335d216fd16afc9 /internal/debug
parent10b3f97c9dcc6f3711aa2d3b1bb43e67eb921223 (diff)
downloadgo-tangerine-48705f8aea04dffb7e772784122aa600bbc60cab.tar
go-tangerine-48705f8aea04dffb7e772784122aa600bbc60cab.tar.gz
go-tangerine-48705f8aea04dffb7e772784122aa600bbc60cab.tar.bz2
go-tangerine-48705f8aea04dffb7e772784122aa600bbc60cab.tar.lz
go-tangerine-48705f8aea04dffb7e772784122aa600bbc60cab.tar.xz
go-tangerine-48705f8aea04dffb7e772784122aa600bbc60cab.tar.zst
go-tangerine-48705f8aea04dffb7e772784122aa600bbc60cab.zip
internal/debug: add debug_setGCPercent
Diffstat (limited to 'internal/debug')
-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)