代码中:
import_"net/http/pprof"
gofunc(){http.ListenAndServe("0.0.0.0:8080",nil)}()
运行中分析
http://ip:port/debug/pprof/ 总览
go tool pprof -alloc_space/-inuse_space http://ip:port/debug/pprof/heap 分析内存 -inuse_space=正在使用
go tool pprof http://ip:port/debug/pprof/profile 分析cpu 可以用 Graphviz
网友评论