-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
cmd/compile: compilation of a few large maps blows up compilers memory usage #22919
Comments
I think you're hitting #21713. I tried your reproducer on tip and the memory usage seems to be of just a few MB. Can you try with tip (to be 1.10) and confirm that the issue is indeed already fixed? |
Thanks for the fast response. |
Nice. Since this is fixed on tip (and the fix won't be backported to earlier releases) there's nothing left to do, so I'm closing this issue. The fix will be included in the next go release (1.10). |
Ok, just for reference (since it is discussed in the referenced issue), the code that triggers this behaviour is not generated. |
What version of Go are you using (
go version
)?1.9.2
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?GOARCH="amd64" GOHOSTARCH="amd64" GOHOSTOS="linux" GOOS="linux" GCCGO="gccgo" CC="gcc" CXX="g++" CGO_ENABLED="1" CGO_CFLAGS="-g -O2" CGO_CPPFLAGS="" CGO_CXXFLAGS="-g -O2" CGO_FFLAGS="-g -O2" CGO_LDFLAGS="-g -O2" PKG_CONFIG="pkg-config" GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build186394948=/tmp/go-build -gno-record-gcc-switches"
What did you do?
Compile (go tool compile, go build, go run, etc)
See gist https://gist.github.com/gustafj/aa3c2e7ba4b3dc2b4701282e73d81646 for a sample that generates a sample program that ends up using ~1GB of ram.
go run main.go
$(go tool -n compile) -memprofile m.prof -goversion go1.9.2 /tmp/go_compile_test.go
go tool pprof -top -alloc_space
go tool -n compilem.prof | head -20
What did you expect to see?
Fast compilation and a memory usage of max a couple of megs.
What did you see instead?
Slow compilation and a memory usage of almost a gig.
(With a little larger map the end result will be SIGKILL due to out of memory, which for me is ~ 30GB)
The text was updated successfully, but these errors were encountered: