Go · Concepts
Go sync.Pool and buffer reuseafter Put, Bytes() isn't yours
In the previous post, total allocations stayed at 256MiB however I set GOGC and GOMEMLIMIT. Reusing short-lived buffers with sync.Pool is one way to shrink it.
Tag
In the previous post, total allocations stayed at 256MiB however I set GOGC and GOMEMLIMIT. Reusing short-lived buffers with sync.Pool is one way to shrink it.
The container limit was 1GB, yet the process was OOMKilled with an 800MB heap. Go has a garbage collector, so how did memory run out?
Following how compiled, statically typed code turns into runtime wins, using Go: memory layout, compiler optimizations, escape analysis, the GC, and the scheduler, each checked with tools.