<pre class="notranslate">This script:

    #!/bin/bash 
    set -e 
    while true; do 
            date 
            rm -rf $GOPATH/pkg/linux_amd64 
            GOMAXPROCS=1 go install -x -work launchpad.net/juju-core/cmd/... 
    done

Breaks down after a couple of tries with errors like:

    pack: non-object file $WORK/launchpad.net/juju-core/cmd/_obj/_go_.6

Preserving the working directory with -work or hacking the code to disable the mkdir
cache do not fix the problem.

Running it without parallelism with -p 1 makes it work reliably.

The full log of such a broken build is attached.</pre>
<p dir="auto">Attachments:</p>
<ol dir="auto">
<li><a href="https://storage.googleapis.com/go-attachment/4105/0/log.txt" rel="nofollow">log.txt</a> (37653 bytes)</li>
</ol>
<p dir="auto">by <strong><a href="mailto:webmaster@webmaster.ms">webmaster@webmaster.ms</a></strong>:</p>
<pre class="notranslate">I use GC 1.0.1 from <a href="http://code.google.com/p/go/downloads/list" rel="nofollow">http://code.google.com/p/go/downloads/list</a>
Windows 2008 Server

Testcase:
===
package main

import (
  "fmt"
  "runtime"
)


func main() {
  for i:=0; i&lt;10000; i++ {
    buf := make([]byte, 0x100000)
    buf[0] = 0 // supress warning

    var ms runtime.MemStats
    runtime.ReadMemStats(&amp;ms)
    fmt.Println(float64(ms.Alloc)/1024.0/1024.0)

    //if (ms.Alloc &gt; 200*1024*1024) { runtime.GC() }
  }
}
===

This works well compiled with 6g, consuming 1-2Mb of memory.
But being compiled with 8g it goes to "out of memory" very quickly.

Adding explicit runtime.GC() call makes memory consumption fluctuate between 120Mb and
200Mb (yes, 120Mb just after runtime.GC() call)</pre>