Re:JVM Anatomy Quarks
by jnordwick on Friday January 31, 2020 @04:16PM
(#22205842)
Not sure if you can even control GCs that well some times. In Java I've worked on projects that never GC once they reach a steady state. I'm not sure I could do the same in Go, or maybe the techniques are just more involved or different?
[ Parent
| on HN ]
Re:JVM Anatomy Quarks
by closeparen on Friday January 31, 2020 @05:19PM
(#22206507)
The technique is basically to preallocate your structs and reuse them via *sync.Pool, never allocate on a hot path. I don't know about "never" GC but it at least minimizes GC, and the pauses are very short.
Re:JVM Anatomy Quarks
by andreygrehov on Friday January 31, 2020 @06:05PM
(#22206889)
Or you can turn off GC altogether by setting an environment variable, GOGC=off.