Created
January 31, 2024 16:27
-
-
Save fjrti/6a438b7820876b696ec5e71715ab536e to your computer and use it in GitHub Desktop.
Saved from https://zhuanlan.zhihu.com/p/671549987
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ( | |
"net/http" | |
_ "net/http/pprof" | |
) | |
func main() { | |
go http.ListenAndServe("0.0.0.0:6001", nil) | |
/* | |
业务代码 | |
*/ | |
} | |
/* | |
go tool pprof -http=:8081 http://ip:port/debug/pprof/allocs | |
*/ | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment