diff options
author | Austin Clements <austin@google.com> | 2016-12-22 18:17:32 -0700 |
---|---|---|
committer | Austin Clements <austin@google.com> | 2016-12-23 23:37:04 +0000 |
commit | a3f4cc06694c8b0bcf14ad36ebc10e66321e3d0f (patch) | |
tree | a537416e621fa1fddb889a1b82a2b4b5007defc1 | |
parent | c8f1436948ca267dc904cf04c67bab7367503107 (diff) | |
download | go-a3f4cc06694c8b0bcf14ad36ebc10e66321e3d0f.tar.gz go-a3f4cc06694c8b0bcf14ad36ebc10e66321e3d0f.zip |
runtime: document MemStats.BySize fields
Change-Id: Iae8cdcd84e9b5f5d7c698abc6da3fc2af0ef839a
Reviewed-on: https://go-review.googlesource.com/34710
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
-rw-r--r-- | src/runtime/mstats.go | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/runtime/mstats.go b/src/runtime/mstats.go index 4e111a14fe..41b9005731 100644 --- a/src/runtime/mstats.go +++ b/src/runtime/mstats.go @@ -174,6 +174,7 @@ type MemStats struct { Lookups uint64 // Mallocs is the cumulative count of heap objects allocated. + // The number of live objects is Mallocs - Frees. Mallocs uint64 // Frees is the cumulative count of heap objects freed. @@ -397,9 +398,19 @@ type MemStats struct { // // This does not report allocations larger than BySize[60].Size. BySize [61]struct { - Size uint32 + // Size is the maximum byte size of an object in this + // size class. + Size uint32 + + // Mallocs is the cumulative count of heap objects + // allocated in this size class. The cumulative bytes + // of allocation is Size*Mallocs. The number of live + // objects in this size class is Mallocs - Frees. Mallocs uint64 - Frees uint64 + + // Frees is the cumulative count of heap objects freed + // in this size class. + Frees uint64 } } |