internal/debug: add debug_freeOSMemory (#15122)

This commit is contained in:
Felix Lange
2017-09-11 09:33:18 +02:00
committed by GitHub
parent 10181b57a9
commit 5596b664c4
2 changed files with 67 additions and 70 deletions

View File

@ -176,6 +176,11 @@ func (*HandlerT) Stacks() string {
return string(buf)
}
// FreeOSMemory returns unused memory to the OS.
func (*HandlerT) FreeOSMemory() {
debug.FreeOSMemory()
}
func writeProfile(name, file string) error {
p := pprof.Lookup(name)
log.Info("Writing profile records", "count", p.Count(), "type", name, "dump", file)