1
0
Fork 0
mirror of https://github.com/chrislusf/seaweedfs synced 2024-06-01 16:22:43 +02:00

debugging: track all memory allocations

This commit is contained in:
Chris Lu 2018-12-31 14:54:13 -08:00
parent 03cfb4267f
commit 81904ad336

View file

@ -2,6 +2,7 @@ package util
import (
"os"
"runtime"
"runtime/pprof"
"github.com/chrislusf/seaweedfs/weed/glog"
@ -19,6 +20,7 @@ func SetupProfiling(cpuProfile, memProfile string) {
})
}
if memProfile != "" {
runtime.MemProfileRate = 1
f, err := os.Create(memProfile)
if err != nil {
glog.Fatal(err)