Skip to content

cmd/compile: Go compiler eats all available system memory #20714

@zlepper

Description

@zlepper

What version of Go are you using (go version)?

go version go1.8 windows/amd64

What operating system and processor architecture are you using (go env)?

set GOARCH=amd64
set GOBIN=
set GOEXE=.exe
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=E:\development\goprojects
set GORACE=
set GOROOT=D:\Go
set GOTOOLDIR=D:\Go\pkg\tool\windows_amd64
set GCCGO=gccgo
set CC=gcc
set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0 -fdebug-prefix-map=C:\Users\hanse\AppData\Local\Temp\go-build350759391=/tmp/go-build -gno-record-gcc-switches
set CXX=g++
set CGO_ENABLED=1
set PKG_CONFIG=pkg-config
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2

What did you do?

Tried to compile to following using go build .
gocompiler.zip

I suspect it's the autogenerated hosting.go file that causes things to explode due to some quite huge string (It's an embedded angular application)

What did you expect to see?

A build program

What did you see instead?

All my memory being eaten.

I have to kill the compiler as it after a couple of seconds uses more than 10GB.
If i just let it run it eats all the memory available on my machine, and the machine has to be reset using the hardware switch.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeToolSpeedWaitingForInfoIssue is not actionable because of missing required information, which needs to be provided.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions