pprof: improve sampling for heap profiling

The current heap sampling introduces some bias that interferes
with unsampling, producing unexpected heap profiles.
The solution is to use a Poisson process to generate the
sampling points, using the formulas described at
https://en.wikipedia.org/wiki/Poisson_process

This fixes #12620

Change-Id: If2400809ed3c41de504dd6cff06be14e476ff96c
Reviewed-on: https://go-review.googlesource.com/14590
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Minux Ma <minux@golang.org>
Run-TryBot: Minux Ma <minux@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
Raul Silvera 2015-09-14 14:03:45 -07:00 committed by Minux Ma
parent 0357c38adf
commit 27ee719fb3
9 changed files with 361 additions and 28 deletions

View file

@ -26,6 +26,8 @@ var Xadduintptr = xadduintptr
var FuncPC = funcPC
var Fastlog2 = fastlog2
type LFNode struct {
Next uint64
Pushcnt uintptr