How to analyize heap profile

122 views
Skip to first unread message

jianfeng ye

unread,
Feb 26, 2015, 10:37:29 PM2/26/15
to golan...@googlegroups.com
I anaylize my heap profile from http debug web: (/debug/pprof/heap?debug=1)

like that :

heap profile: 18: 134624 [119: 1410912] @ heap/1048576
1: 90112 [1: 90112] @ 0x424ba5 0x424688 0x425dd1 0x425e5a 0x4209a5 0x421d7d 0x422ae6 0x67d6e4 0x614b6f 0x4d155b 0x4016fd 0x411c1a 0x414420
#       0x424ba5        profilealloc+0xb5               /usr/local/go/src/pkg/runtime/malloc.goc:258
#       0x424688        runtime.mallocgc+0x218          /usr/local/go/src/pkg/runtime/malloc.goc:197
#       0x425dd1        cnew+0xc1                       /usr/local/go/src/pkg/runtime/malloc.goc:836
#       0x425e5a        runtime.cnewarray+0x3a          /usr/local/go/src/pkg/runtime/malloc.goc:849
#       0x4209a5        hash_grow+0x75                  /usr/local/go/src/pkg/runtime/hashmap.goc:336
#       0x421d7d        hash_insert+0x3cd               /usr/local/go/src/pkg/runtime/hashmap.goc:534
#       0x422ae6        runtime.mapassign1+0x46         /usr/local/go/src/pkg/runtime/hashmap.goc:933
#       0x67d6e4        html.init+0xd4                  /usr/local/go/src/pkg/html/entity.go:2155
#       0x614b6f        html/template.init+0x7f         /usr/local/go/src/pkg/html/template/url.go:105
#       0x4d155b        net/http/pprof.init+0x7b        /usr/local/go/src/pkg/net/http/pprof/pprof.go:205
#       0x4016fd        main.init+0x5d                  /home/yejianfeng/gocode/src/bpusher/main.go:78
#       0x411c1a        runtime.main+0xda               /usr/local/go/src/pkg/runtime/proc.c:240

1: 12288 [1: 12288] @ 0x424ba5 0x424688 0x425dd1 0x425e5a 0x4209a5 0x421d7d 0x422ae6 0x633c41 0x633dc3 0x6351de 0x53e83f 0x635014 0x63678e 0x5919db 0x590ea0 0x58f5c0 0x4c667b 0x414420
#       0x424ba5        profilealloc+0xb5                                               /usr/local/go/src/pkg/runtime/malloc.goc:258
#       0x424688        runtime.mallocgc+0x218                                          /usr/local/go/src/pkg/runtime/malloc.goc:197
#       0x425dd1        cnew+0xc1                                                       /usr/local/go/src/pkg/runtime/malloc.goc:836
#       0x425e5a        runtime.cnewarray+0x3a                                          /usr/local/go/src/pkg/runtime/malloc.goc:849
#       0x4209a5        hash_grow+0x75                                                  /usr/local/go/src/pkg/runtime/hashmap.goc:336
#       0x421d7d        hash_insert+0x3cd                                               /usr/local/go/src/pkg/runtime/hashmap.goc:534
#       0x422ae6        runtime.mapassign1+0x46                                         /usr/local/go/src/pkg/runtime/hashmap.goc:933
#       0x633c41        crypto/x509.(*CertPool).AddCert+0x531                           /usr/local/go/src/pkg/crypto/x509/cert_pool.go:76
#       0x633dc3        crypto/x509.(*CertPool).AppendCertsFromPEM+0x153                /usr/local/go/src/pkg/crypto/x509/cert_pool.go:101
#       0x6351de        crypto/x509.initSystemRoots+0x17e                               /usr/local/go/src/pkg/crypto/x509/root_unix.go:29
#       0x53e83f        sync.(*Once).Do+0x9f                                            /usr/local/go/src/pkg/sync/once.go:40
#       0x635014        crypto/x509.systemRootsPool+0x34                                /usr/local/go/src/pkg/crypto/x509/root.go:15
#       0x63678e        crypto/x509.(*Certificate).Verify+0x8e                          /usr/local/go/src/pkg/crypto/x509/verify.go:217
#       0x5919db        crypto/tls.(*clientHandshakeState).doFullHandshake+0x62b        /usr/local/go/src/pkg/crypto/tls/handshake_client.go:249
#       0x590ea0        crypto/tls.(*Conn).clientHandshake+0x1310                       /usr/local/go/src/pkg/crypto/tls/handshake_client.go:184
#       0x58f5c0        crypto/tls.(*Conn).Handshake+0xf0                               /usr/local/go/src/pkg/crypto/tls/conn.go:974
#       0x4c667b        net/http.func·021+0x3b                                          /usr/local/go/src/pkg/net/http/transport.go:577

3: 12288 [3: 12288] @ 0x424ba5 0x424688 0x425dd1 0x425e5a 0x42938d 0x4292c3 0x58b0fb 0x58b212 0x58bea2 0x58de06 0x591418 0x590ea0 0x58f5c0 0x4c667b 0x414420
#       0x424ba5        profilealloc+0xb5                                       /usr/local/go/src/pkg/runtime/malloc.goc:258
#       0x424688        runtime.mallocgc+0x218                                  /usr/local/go/src/pkg/runtime/malloc.goc:197
#       0x425dd1        cnew+0xc1                                               /usr/local/go/src/pkg/runtime/malloc.goc:836
#       0x425e5a        runtime.cnewarray+0x3a                                  /usr/local/go/src/pkg/runtime/malloc.goc:849
#       0x42938d        makeslice1+0x4d                                         /usr/local/go/src/pkg/runtime/slice.goc:55
#       0x4292c3        runtime.makeslice+0xb3                                  /usr/local/go/src/pkg/runtime/slice.goc:36
#       0x58b0fb        crypto/tls.(*block).reserve+0x7b                        /usr/local/go/src/pkg/crypto/tls/conn.go:435
#       0x58b212        crypto/tls.(*block).readFromUntil+0x72                  /usr/local/go/src/pkg/crypto/tls/conn.go:449
#       0x58bea2        crypto/tls.(*Conn).readRecord+0x8b2                     /usr/local/go/src/pkg/crypto/tls/conn.go:583
#       0x58de06        crypto/tls.(*Conn).readHandshake+0xe6                   /usr/local/go/src/pkg/crypto/tls/conn.go:776
#       0x591418        crypto/tls.(*clientHandshakeState).doFullHandshake+0x68 /usr/local/go/src/pkg/crypto/tls/handshake_client.go:214
#       0x590ea0        crypto/tls.(*Conn).clientHandshake+0x1310               /usr/local/go/src/pkg/crypto/tls/handshake_client.go:184
#       0x58f5c0        crypto/tls.(*Conn).Handshake+0xf0                       /usr/local/go/src/pkg/crypto/tls/conn.go:974
#       0x4c667b        net/http.func·021+0x3b                                  /usr/local/go/src/pkg/net/http/transport.go:577


but I don't know how to analyize that? 

Is there anybody help me?


Peter Waller

unread,
Feb 27, 2015, 3:50:13 AM2/27/15
to jianfeng ye, golang-nuts
This is the raw data, you probably want to look at the output using `go tool pprof <binary name> <web url>`. When the tool starts, type "web", which will show you a graphical presentation of the data using SVG.

Useful article that explains it:


(from memory, apologies for any errors. In case of errors, try small obvious adjustments)

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages