Descriptionruntime: account for all sys memory in MemStats
Currently lots of sys allocations are not accounted in any of XxxSys,
including GC bitmap, spans table, GC roots blocks, GC finalizer blocks,
iface table, netpoll descriptors and more. Up to ~20% can unaccounted.
This change introduces 2 new stats: GCSys and OtherSys for GC metadata
and all other misc allocations, respectively.
Also ensures that all XxxSys indeed sum up to Sys. All sys memory allocation
functions require the stat for accounting, so that it's impossible to miss something.
Also fix updating of mcache_sys/inuse, they were not updated after deallocation.
test/bench/garbage/parser before:
Sys 670064344
HeapSys 610271232
StackSys 65536
MSpanSys 14204928
MCacheSys 16384
BuckHashSys 1439992
after:
Sys 670064344
HeapSys 610271232
StackSys 65536
MSpanSys 14188544
MCacheSys 16384
BuckHashSys 3194304
GCSys 39198688
OtherSys 3129656
Fixes issue 5799.
Patch Set 1 #Patch Set 2 : diff -r a5954109dae3 https://dvyukov%40google.com@code.google.com/p/go/ #Patch Set 3 : diff -r d08cc21a0d0d https://dvyukov%40google.com@code.google.com/p/go/ #Patch Set 4 : diff -r aaaa190f025d https://dvyukov%40google.com@code.google.com/p/go/ #Patch Set 5 : diff -r aaaa190f025d https://dvyukov%40google.com@code.google.com/p/go/ #Patch Set 6 : diff -r 6d4efbff17ed https://dvyukov%40google.com@code.google.com/p/go/ #Patch Set 7 : diff -r 6d4efbff17ed https://dvyukov%40google.com@code.google.com/p/go/ #Patch Set 8 : diff -r 6d4efbff17ed https://dvyukov%40google.com@code.google.com/p/go/ #Patch Set 9 : diff -r 6d4efbff17ed https://dvyukov%40google.com@code.google.com/p/go/ #Patch Set 10 : diff -r 6d4efbff17ed https://dvyukov%40google.com@code.google.com/p/go/ #
Total comments: 2
Patch Set 11 : diff -r 5037426bea2f https://dvyukov%40google.com@code.google.com/p/go/ #
Total comments: 1
MessagesTotal messages: 13
|