diff options
author | Russ Cox <rsc@golang.org> | 2010-03-29 13:06:26 -0700 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2010-03-29 13:06:26 -0700 |
commit | 3e6f4ce5aa0e07a8f1c7644b5ba0ff39109b8eba (patch) | |
tree | 40d39bf8a417fec879597482abd81def99b712aa /src/pkg/runtime/extern.go | |
parent | 248f40a7171a458ff13c524fea0f05e6854748ec (diff) | |
download | golang-3e6f4ce5aa0e07a8f1c7644b5ba0ff39109b8eba.tar.gz |
runtime: more malloc statistics
expvar: default publishings for cmdline, memstats
godoc: import expvar
R=r
CC=golang-dev
http://codereview.appspot.com/815041
Diffstat (limited to 'src/pkg/runtime/extern.go')
-rw-r--r-- | src/pkg/runtime/extern.go | 48 |
1 files changed, 34 insertions, 14 deletions
diff --git a/src/pkg/runtime/extern.go b/src/pkg/runtime/extern.go index 17ef63440..bcef7244a 100644 --- a/src/pkg/runtime/extern.go +++ b/src/pkg/runtime/extern.go @@ -134,20 +134,40 @@ func Signame(sig int32) string func Siginit() type MemStatsType struct { - Alloc uint64 - TotalAlloc uint64 - Sys uint64 - Stacks uint64 - InusePages uint64 - NextGC uint64 - HeapAlloc uint64 - Lookups uint64 - Mallocs uint64 - PauseNs uint64 - NumGC uint32 - EnableGC bool - DebugGC bool - BySize [67]struct { + // General statistics. + // Not locked during update; approximate. + Alloc uint64 // bytes allocated and still in use + TotalAlloc uint64 // bytes allocated (even if freed) + Sys uint64 // bytes obtained from system (should be sum of XxxSys below) + Lookups uint64 // number of pointer lookups + Mallocs uint64 // number of mallocs + + // Main allocation heap statistics. + HeapAlloc uint64 // bytes allocated and still in use + HeapSys uint64 // bytes obtained from system + HeapIdle uint64 // bytes in idle spans + HeapInuse uint64 // bytes in non-idle span + + // Low-level fixed-size structure allocator statistics. + // Inuse is bytes used now. + // Sys is bytes obtained from system. + StackInuse uint64 // bootstrap stacks + StackSys uint64 + MSpanInuse uint64 // mspan structures + MSpanSys uint64 + MCacheInuse uint64 // mcache structures + MCacheSys uint64 + + // Garbage collector statistics. + NextGC uint64 + PauseNs uint64 + NumGC uint32 + EnableGC bool + DebugGC bool + + // Per-size allocation statistics. + // Not locked during update; approximate. + BySize [67]struct { Size uint32 Mallocs uint64 Frees uint64 |