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]
时间: 2024-10-27 20:39:36