Browse Source

print out memory size

pull/895/head
Chris Lu 6 years ago
parent
commit
95ef4513c8
  1. 2
      weed/storage/needle/compact_map_perf_test.go

2
weed/storage/needle/compact_map_perf_test.go

@ -82,7 +82,7 @@ func PrintMemUsage(totalRowCount uint64) {
var m runtime.MemStats
runtime.ReadMemStats(&m)
// For info on each, see: https://golang.org/pkg/runtime/#MemStats
fmt.Printf("Each %v Bytes", m.Alloc/totalRowCount)
fmt.Printf("Each %.2f Bytes", float64(m.TotalAlloc)/float64(totalRowCount))
fmt.Printf("\tAlloc = %v MiB", bToMb(m.Alloc))
fmt.Printf("\tTotalAlloc = %v MiB", bToMb(m.TotalAlloc))
fmt.Printf("\tSys = %v MiB", bToMb(m.Sys))

Loading…
Cancel
Save