diff options
Diffstat (limited to 'internal/debug/api.go')
-rw-r--r-- | internal/debug/api.go | 6 |
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) |