Go Gc Tuning

Tune Go memory and garbage collection for a service in a container. Observes first with GODEBUG=gctrace=1 and runtime/metrics (live heap, GC cycles, GC CPU seconds), cuts allocation before touching knobs using a heap profile read with alloc_space, gcflags=-m escape output and benchmarks with -benchmem and benchstat, then sets GOMEMLIMIT near 90 percent of the container limit while keeping GOGC as the CPU versus memory trade, accounting for non-heap memory and never using GOGC=off without a limit. Use for "Go service OOMKilled but heap looks small", "GC takes 30% of CPU", "what should GOGC be", "how to use GOMEMLIMIT", "high allocation rate in a hot path", "tail latency from GC". Not for generic CPU profiling or the execution tracer (profiling), the JVM equivalent (jvm-gc-tuning), goroutines that never exit (go-goroutine-leak), fleet sizing (capacity-planning).

greenblacked Updated
The twenty-nine plugins: coding, family, gamedev, operations, delivery, security, manager, personal, career, design, llm, data, techdocs, assurance, client-apps

File contents

greenblacked/AI commit b353bf8961

Frequently asked questions

npx get-skill add greenblacked/go-gc-tuning