Skip to content

cmd/compile: consumes huge amount of memory when compiling table driven test code #11612

Closed
@rin01

Description

@rin01

uname -a
Linux nico-Qiana-Xfce 3.13.0-24-generic #47-Ubuntu SMP Fri May 2 23:30:00 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

go version go1.4.2 linux/amd64

When I click on "share" button in Go playground to share the problematic code, it fails with "server error: try again" message.
I imagine it is because the source code is too big (~8000 lines).

But you can find a small version here:

http://play.golang.org/p/qpxcVGkzuk

It compiles quickly without any problem because it has only 500 lines in the "samples" table.

But if you copy-paste these sample lines to have 8000 of them in the "samples" table, 6g consumes more than 2.5 Gb and then, it is killed, or crashes Virtualbox.

This problem is related to issue "cmd/go: go build takes too long to compile table driven test code":
#8259

But this time, it is not the compile time which is the problem, but the memory consumption, which is really high.
Even with 2.5 Gb of ram allocated to Virtualbox, 6g consumes all the available ram before being killed.

With go 1.3.2, I could compile, even if I should allocate at least 2.4 Gb of ram to Virtualbox.
But with go 1.4.2, the memory consumption has increased so much that I cannot compile the same code any more.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions