It should be clear from the source code, but I'm using two calls to 
runtime.GC() followed by runtime.ReadMemStats().

On Thursday, December 22, 2016 at 12:06:13 PM UTC-5, Ian Lance Taylor wrote:
>
> On Thu, Dec 22, 2016 at 8:16 AM,  <dr...@pendo.io <javascript:>> wrote: 
> > 
> > I was just toying around with pointers to slice elements, and I ended up 
> > with this Go program: https://play.golang.org/p/D6e2SHEW1f. By the end 
> of 
> > the program, all references to memory in the main function are dropped, 
> but 
> > memory isn't freed after a call to runtime.GC(). This happens both in 
> the Go 
> > Playground and on my local machine (though the latter is running Go 
> 1.6). 
> > 
> > Is it just that runtime.GC() is not triggering a full GC and a later run 
> > would clear the memory? Any insight here would be appreciated, as I'm 
> really 
> > curious now. Also, this isn't just a toy problem; it reflects some 
> actual 
> > code I'm working on. 
>
> How are you determining that "memory isn't freed"?  There are several 
> possible meanings for that. 
>
> Ian 
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to