3 ms·
Uh. Citation needed.
by AndyKelley 11y ago
Uh. Citation needed.
- bitdivision 11y agoYou can set the environment variable GOGC=off [1] There doesn't actually seem to be a way to explicitly free memory though so I doubt this is actually used. [1]: https://golang.org/pkg/runtime/ https://golang.org/pkg/runtime/
- Zancarius 11y agoIt's only intended for debugging purposes, near as I can tell (and I'm not sure why anyone would want to do it in the first place beyond debugging): https://github.com/golang/go/issues/13761#issuecomment-167721220 https://github.com/golang/go/issues/13761#issuecomment-16772...
- deleted 11y ago[deleted]
- d0lph 11y agoI stand corrected, there doesn't seem to be a way to manually allocate and de-allocate memory. Looks like there is a switch to turn off GC, but it's intended for debugging.