You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
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?
ALTree
changed the title
Compilation of a few large maps blows up compilers memory usage
cmd/compile: compilation of a few large maps blows up compilers memory usage
Nov 29, 2017
Thanks for the fast response.
The issue is indeed fixed in tip.
Both my test and the original code that triggered the issue compiles with "normal" memory footprint (2.5MB / 37MB) when using tip.
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.
It is a couple quite large lookup tables which are manually created.
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: