• Russ Cox's avatar
    runtime: fix malloc sampling bug · ad35cea7
    Russ Cox authored
    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
    ad35cea7
malloc.goc 13.7 KB