mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-02-09 09:17:28 +08:00
debugging: track all memory allocations
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user