Conversation

Replying to
From golang's own accounting: Alloc: 31324248 Sys: 917090656 - 900 megs of system memory for 31 megs of live heap-allocated objects. But I am not sure yet, I am in the process of root-causing what is going on.
1
2
Go doesn't use a moving (compacting) GC, so it isn't good at reclaiming memory from small objects. They've chosen to value low pause times and minimal impact on the latency / throughput of pointer accesses above everything else. It uses lots of memory and has bad throughput.
1
2
Mainstream modern garbage collectors are compacting, generational collectors, so they repeatedly compact the heap by copying all of the live objects to a new one. Long-lived objects end up moving into older generation heaps. Go takes another path of trying to use the stack more.
1