Golang pprof heap profile is empty

Q:

When you use `go tool pprof` get heap data, profile is empty.

A:

The default sampling rate is 1 sample per 512KB of allocated memory.

So If you application use little memory, the profiling can't sampling any data.

You can change runtime.MemProfileRate to reduce sampling rate.

The easy way is add Environment Variables GODEBUG="memprofilerate=1", before run you application.

 

[via]

[via]

[via]

posted on 2016-07-15 11:24  eshizhan  阅读(1570)  评论(0编辑  收藏  举报