-
Notifications
You must be signed in to change notification settings - Fork 18.3k
Description
This is my first time submitting to Go, apologies in advance if it is a non-helpful issue.
- What version of Go are you using (
go version)?
1.6 - What operating system and processor architecture are you using (
go env)?
GOARCH="amd64"
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fno-common"
CXX="clang++" - What did you do?
(Use play.golang.org to provide a runnable example, if possible.)
Sorry in advance, I am not able to extract a runnable example at the moment as it is a larger program I am debugging.
I am having issues with the GC in Go. Specifically, it does not seem to release idle heap memory back to the system, even after +10 minutes of inactivity (based on this) in the code/area that generated the initial garabage in the program.
Heap in use and allocated match one another (makes sense).
Heap sys = heap idle (this does not make sense to me).
- What did you expect to see?
Heap idle to decrease. - What did you see instead?
Heap idle does not decrease over time. I even calledruntime.GC()and thendebug.FreeOSMemory()as well in attempt to release the memory.
Other information
Memory profile information from MemStats logged every 2 seconds:

I did reading of different sources and it one thought I see is that the GC may release memory, but it is up to the OS to collect/ask for it. Is this correct? Does this mean the memory footprint will not decrease without external intervention?
I thought maybe this problem has to do with #13552, however from 1.5 to 1.6 made no difference for me.
Thank you for your time.