Skip to content

Instantly share code, notes, and snippets.

@davidbirdsong
Created May 3, 2016 21:17
Show Gist options
  • Select an option

  • Save davidbirdsong/cbbaffcfecf0c53c1be2ca146b224ec1 to your computer and use it in GitHub Desktop.

Select an option

Save davidbirdsong/cbbaffcfecf0c53c1be2ca146b224ec1 to your computer and use it in GitHub Desktop.
tls allocations
[david@sjc1-b4-8 ~]$ go tool pprof $HOME/bin/hwy-fetcher http://localhost:6060/debug/pprof/heap
Fetching profile from http://localhost:6060/debug/pprof/heap
Saved profile in /home/david/pprof/pprof.hwy-fetcher.localhost:6060.inuse_objects.inuse_space.062.pb.gz
Entering interactive mode (type "help" for commands)
(pprof) top
12612.08MB of 14824.44MB total (85.08%)
Dropped 799 nodes (cum <= 74.12MB)
Showing top 10 nodes out of 87 (cum >= 201.56MB)
flat flat% sum% cum cum%
6202.85MB 41.84% 41.84% 6202.85MB 41.84% crypto/tls.(*block).reserve
1432.71MB 9.66% 51.51% 1545.80MB 10.43% net/http.(*Transport).dialConn
1096.04MB 7.39% 58.90% 1096.04MB 7.39% bytes.makeSlice
998.50MB 6.74% 65.64% 1059.50MB 7.15% net/textproto.MIMEHeader.Set
966.28MB 6.52% 72.15% 1012.28MB 6.83% net/textproto.(*Reader).ReadMIMEHeader
614.01MB 4.14% 76.30% 1126.58MB 7.60% crypto/x509.parseCertificate
402.05MB 2.71% 79.01% 1136.32MB 7.67% crypto/tls.(*Conn).readHandshake
369.57MB 2.49% 81.50% 7424.22MB 50.08% main.(*Requestor).reachOut
328.52MB 2.22% 83.72% 328.52MB 2.22% reflect.unsafe_NewArray
201.56MB 1.36% 85.08% 201.56MB 1.36% net/textproto.(*Reader).ReadLine
(pprof) list reserve
Total: 14.48GB
ROUTINE ======================== crypto/tls.(*block).reserve in /usr/local/go/src/crypto/tls/conn.go
6.06GB 6.06GB (flat, cum) 41.84% of Total
. . 439: m = 1024
. . 440: }
. . 441: for m < n {
. . 442: m *= 2
. . 443: }
6.06GB 6.06GB 444: data := make([]byte, len(b.data), m)
. . 445: copy(data, b.data)
. . 446: b.data = data
. . 447:}
. . 448:
. . 449:// readFromUntil reads from r into b until b contains at least n bytes
(pprof)
@davidbirdsong
Copy link
Author

oh, also go version might be helpful:

david@sjc1-b4-8 ~]$ go version 
go version go1.6.2 linux/amd64

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment