blob: c671efc4dd16ab74c9ba9f969cc1ecc34fef9730 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
package stats
import (
"runtime"
"github.com/chrislusf/seaweedfs/weed/pb/volume_server_pb"
)
func MemStat() *volume_server_pb.MemStatus {
mem := &volume_server_pb.MemStatus{}
mem.Goroutines = int32(runtime.NumGoroutine())
memStat := new(runtime.MemStats)
runtime.ReadMemStats(memStat)
mem.Self = memStat.Alloc
mem.Heap = memStat.HeapAlloc
mem.Stack = memStat.StackInuse
fillInMemStatus(mem)
return mem
}
|