]> Cypherpunks repositories - gostls13.git/commit
runtime: fix malloc sampling bug
authorRuss Cox <rsc@golang.org>
Thu, 6 Oct 2011 15:30:48 +0000 (11:30 -0400)
committerRuss Cox <rsc@golang.org>
Thu, 6 Oct 2011 15:30:48 +0000 (11:30 -0400)
commitad35cea7622a6fb839f06bb5b46cee9110fa94a0
tree0472a0afaf739f32faa843d93f90a62f6e843ed3
parent56959158331072ed17801aa539a0d6f28064b511
runtime: fix malloc sampling bug

The malloc sample trigger was not being set in a
new m, so the first allocation in each new m - the
goroutine structure - was being sampled with
probability 1 instead of probability sizeof(G)/rate,
an oversampling of about 5000x for the default
rate of 1 MB.  This bug made pprof graphs show
far more G allocations than there actually were.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5224041
src/pkg/runtime/malloc.goc