Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

question: make([]byte, len, len) heap leaks #18002

Closed
blinkinglight opened this issue Nov 21, 2016 · 1 comment
Closed

question: make([]byte, len, len) heap leaks #18002

blinkinglight opened this issue Nov 21, 2016 · 1 comment

Comments

@blinkinglight
Copy link

go version go1.7.1 darwin/amd64 and binary runs on linux and compiled from osx with GOOS=linux GOARCH=amd64

(pprof) top
1.25GB of 1.25GB total (99.84%)
Dropped 209 nodes (cum <= 0.01GB)
flat flat% sum% cum cum%
1.25GB 99.84% 99.84% 1.25GB 99.84% main.tvACL.backendRequest
0 0% 99.84% 1.25GB 99.84% github.com/golang/groupcache/singleflight.(*Group).Do
0 0% 99.84% 1.25GB 99.84% github.com/gorilla/mux.(*Router).ServeHTTP
0 0% 99.84% 1.25GB 99.84% main.(*tvACL).ServeHTTP
0 0% 99.84% 1.25GB 99.84% main.tvACL.ServeHTTP
0 0% 99.84% 1.25GB 99.84% main.tvACL.ServeTV
0 0% 99.84% 1.25GB 99.84% main.tvACL.ServeTV.func3
0 0% 99.84% 1.25GB 99.84% net/http.(*conn).serve
0 0% 99.84% 1.25GB 99.84% net/http.serverHandler.ServeHTTP
0 0% 99.84% 1.25GB 100% runtime.goexit
(pprof)

(pprof) list main.tvACL.backendRequest
Total: 1.25GB
ROUTINE ======================== main.tvACL.backendRequest in /Users/mindaugas/code/rubinet/rb-cache/tvacl.go
1.25GB 1.25GB (flat, cum) 99.84% of Total
<...>
1.25GB 1.25GB 396: buff := make([]byte, resp.ContentLength, resp.ContentLength)

(pprof) list runtime.goexit
Total: 1.25GB
ROUTINE ======================== runtime.goexit in /usr/local/go/src/runtime/asm_amd64.s
0 1.25GB (flat, cum) 100% of Total
. . 2081: RET
. . 2082:
. . 2083:// The top-most function running on a goroutine
. . 2084:// returns to goexit+PCQuantum.
. . 2085:TEXT runtime·goexit(SB),NOSPLIT,$0-0
. 1.25GB 2086: BYTE $0x90 // NOP
. . 2087: CALL runtime·goexit1(SB) // does not return
. . 2088: // traceback from goexit1 must hit code range of goexit
. . 2089: BYTE $0x90 // NOP
. . 2090:
. . 2091:TEXT runtime·prefetcht0(SB),NOSPLIT,$0-8
(pprof)

@bradfitz
Copy link
Contributor

For questions about Go, see https://golang.org/wiki/Questions

@golang golang locked and limited conversation to collaborators Nov 21, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants