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]

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-06
  • 2021-09-18
  • 2022-12-23
猜你喜欢
  • 2021-12-15
  • 2021-06-01
  • 2021-09-06
  • 2022-12-23
  • 2022-12-23
  • 2022-02-25
  • 2021-10-23
相关资源
相似解决方案