aboutsummaryrefslogtreecommitdiffstats
path: root/internal/debug/api.go
diff options
context:
space:
mode:
authorFelix Lange <fjl@users.noreply.github.com>2017-09-11 15:33:18 +0800
committerGitHub <noreply@github.com>2017-09-11 15:33:18 +0800
commit5596b664c4ca5be199bb93f87155fa2c1fa7eab2 (patch)
tree2bcf87f69fc036695e079356459bc78dbb1a0cec /internal/debug/api.go
parent10181b57a9fb648f5fd424ca611820a3cf42c42b (diff)
downloaddexon-5596b664c4ca5be199bb93f87155fa2c1fa7eab2.tar.gz
dexon-5596b664c4ca5be199bb93f87155fa2c1fa7eab2.tar.zst
dexon-5596b664c4ca5be199bb93f87155fa2c1fa7eab2.zip
internal/debug: add debug_freeOSMemory (#15122)
Diffstat (limited to 'internal/debug/api.go')
-rw-r--r--internal/debug/api.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/internal/debug/api.go b/internal/debug/api.go
index 8b7693f6a..7583878ed 100644
--- a/internal/debug/api.go
+++ b/internal/debug/api.go
@@ -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)