ThinkChat🤖让你学习和工作更高效,注册即送10W Token,即刻开启你的AI之旅 广告
> ### pprof工具介绍 * go中提供了pprof包来做代码的性能监控,在两个地方有包: * runtime/pprof * net/http/pprof (net/http/pprof中只是使用runtime/pprof包来进行封装了一下,并在http端口上暴露出来) > ### runtime/pprof * top * list 函数名 * web (图形界面, 需要安装graphviz) * 安装graphviz(图形绘制工具软件) * 将安装目录下的bin文件配置到环境变量Path中(C:\\Program Files (x86)\\Graphviz2.38\\bin)-重启电脑 > ### 相关阅读 * 使用go tool pprof分析内存泄漏、CPU消耗 :[https://www.cnblogs.com/ghj1976/p/5473693.html](https://www.cnblogs.com/ghj1976/p/5473693.html)