生涯未熟

生涯未熟

プログラミングをちょこちょこと。

Golangで雑にメモリ状況を見る

pprof使うほどでもないよなってなったので、こんな感じで雑に。

var mem runtime.MemStats
runtime.ReadMemStats(&mem)
fmt.Printf("Alloc [%v] \t HeapAlloc [%v] \n", mem.Alloc, mem.HeapAlloc)