Grokking Advanced Go
Vote

0% completed

​

GOGC and GOMEMLIMIT

An order service holds 100 MB of live data on its heap. How large will the heap grow before the next garbage collection finishes? If the service then runs in a container with 200 MB of memory, is that safe?

Two settings answer these questions. GOGC sets how much the heap may grow in proportion to the live data. GOMEMLIMIT sets a total amount of memory that the runtime tries to stay within.

The sections below give the formula that connects GOGC to memory and CPU, the effect of a memory limit, and the values that make sense in a container.

.....

.....

.....

Like the course? Get enrolled and start learning!

Reading Progress

0%


Vote for new content