<p dir="auto">by <strong>peter.polakovic</strong>:</p>
<pre class="notranslate">When working with large images I found, that windows port doesn't free large chunks of
memory.

The following code

package main

import "fmt"
import "runtime"

func main() {
  for i:=0; i&lt;10; i++ {
    a := make([]byte, 5000000)
    if a == nil { }
    a = nil    
    runtime.GC()
    fmt.Println(i, runtime.MemStats.Alloc, runtime.MemStats.Sys, runtime.MemStats.HeapObjects)
  }
  fmt.Println()
  for i:=0; i&lt;10; i++ {
    a := make([]byte, 20000000)
    if a == nil { }
    a = nil    
    runtime.GC()
    fmt.Println(i, runtime.MemStats.Alloc, runtime.MemStats.Sys, runtime.MemStats.HeapObjects)
  }  
}

produces the following output

0 5176576 8887420 422
1 5213848 14564476 433
2 5213848 14564476 433
3 5213848 14564476 433
4 5213848 14564476 433
5 5213848 14564476 433
6 5213848 14564476 433
7 5213848 14564476 433
8 5213848 14564476 433
9 5213848 14564476 433

0 20250336 37125244 436
1 40288024 59686012 442
2 60325656 82246780 444
3 80363288 104807548 446
4 100400920 127368316 448
5 100437784 149929084 449
6 120438552 149929084 450
7 120475416 172489852 451
8 140476184 172489852 452
9 140513048 195050620 453

On OS X port first part of output seems similar to second one (allocated memory and
number of heap objects is the same in each iteration).

The same result when using runtime.Malloc() and runtime.Free().

I'm using binary distribution of release.r57.1 on Windows7 (32 bit).</pre>
<p dir="auto">by <strong>prencher</strong>:</p>
<pre class="notranslate">This was originally reported in issue #4829. I posted a comment on it, but as it has
been marked fixed, I don't know if that is monitored. If it is, please by all means
close this issue as a duplicate and accept my apology.

When trying to get packages that depend on cgo, I get the error "argument unused
during compilation: '-fno-eliminate-unused-debug-types'":

$ go get bazil.org/fuse
# bazil.org/fuse
clang: error: argument unused during compilation: '-fno-eliminate-unused-debug-types'

$ go version
go version devel +f4d1cb8d9a91 Thu Sep 19 22:34:33 2013 +1000 darwin/amd64

$ gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr
--with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 5.0 (clang-500.2.76) (based on LLVM 3.3svn)
Target: x86_64-apple-darwin12.5.0
Thread model: posix

$ clang --version
Apple LLVM version 5.0 (clang-500.2.75) (based on LLVM 3.3svn)
Target: x86_64-apple-darwin12.5.0
Thread model: posix</pre>