Fetching profile over HTTP from http://localhost:82/debug/pprof/profile
http://localhost:82/debug/pprof/profile: Get "http://localhost:82/debug/pprof/profile": dial tcp [::1]:82: connectex: No connection could be made because the target machine actively refused it.
failed to fetch any source profile
启动示例代码:
package main import ( "fmt" "net/http" ) import _ "net/http/pprof" func main() { var addTomap = func() { //s := []int{1, 2, 3} //s2 := make([]int, 0) var slice = []int{1} var slice2 = make([]int, 0) fmt.Printf("%p n", slice) fmt.Printf("%p", slice2) } addTomap() http.ListenAndServe(":81", nil) }
启动上述代码服务
访问:http://localhost:81/debug/pprof/