<p dir="auto">by <strong>fibercut</strong>:</p>
<pre class="notranslate">What steps will reproduce the problem?

package main

import (
    "fmt"
)

type Node struct {
    line   string
    unused [50]int
}

const (
    LOOPS = 300 // consume ~ 1G of RAM, increase this at your own risk
    MAX   = 30000
    STR   = "1 2 3 4 5 6 7 8 9 0"
)

func main() {
    for i := 1; i &lt; LOOPS; i++ {
        p := new([MAX]Node)[0:MAX]
        for j := 0; j &lt; MAX; j++ {
            p[j].line = STR
        }
        fmt.Printf("%v\n", i)
    }
}

What is the expected output?

On 64 bit Ubuntu (6g) to above program stays at a comfortable 45M memory consumption,
even for much larger values of LOOPS.

What do you see instead?

The above program consumes &gt; 1G of RAM quickly on 32 bit systems (8g).

Which compiler are you using (5g, 6g, 8g, gccgo)?

8g

Which operating system are you using?

Linux (ubuntu)

Which revision are you using?  (hg identify)

ca4f9687cec0 release.2010-10-13.1/release

Please provide any additional information below.</pre>
<p dir="auto">Expected behavior: go test works</p>
<p dir="auto">Actual behavior: go test fails because it trips over long paths it itself constructs for building and running the tests</p>
<p dir="auto">Output of "go version":<br>
go version go1.4.2 windows/amd64</p>
<p dir="auto">Repro steps:</p>
<p dir="auto">C:\Users\lukasza\my\enlistment\has\rather\long\and\descriptive\paths\that\I\rather\like\and\enjoy&gt;type foo\foo.go</p>
<p dir="auto">package foo</p>
<p dir="auto">func Foo() string {<br>
return "foo"<br>
}</p>
<p dir="auto">C:\Users\lukasza\my\enlistment\has\rather\long\and\descriptive\paths\that\I\rather\like\and\enjoy&gt;type foo\foo_test.go</p>
<p dir="auto">package foo</p>
<p dir="auto">import "testing"</p>
<p dir="auto">func TestFoo(t *testing.T) {<br>
t.Log("Testing foo")<br>
}</p>
<p dir="auto">C:\Users\lukasza\my\enlistment\has\rather\long\and\descriptive\paths\that\I\rather\like\and\enjoy&gt;go test .\foo</p>
<h1 dir="auto"><em>/C</em>/Users/lukasza/my/enlistment/has/rather/long/and/descriptive/paths/that/I/rather/like/and/enjoy/foo</h1>
<p dir="auto">mkdir C:\Users\lukasza\AppData\Local\Temp\go-build344025871_\C_\Users\lukasza\my\enlistment\has\rather\long\and\descriptive\paths\that\I\rather\like\and\enjoy<br>
foo_test_\C_\Users\lukasza\my\enlistment\has\rather\long\and\descriptive\paths\that\I\rather: The filename or extension is too long.<br>
FAIL    <em>/C</em>/Users/lukasza/my/enlistment/has/rather/long/and/descriptive/paths/that/I/rather/like/and/enjoy/foo [setup failed]</p>