API-security platform · 2025–2026
A memory leak in a Go component
Problem
A component of a distributed Kubernetes installation grew without bound under load and was OOM-killed on reaching its memory limit. It could only be reproduced in the cluster: stand up a multi-component bench, apply load, wait. The check cycle ran in hours, so development's hypotheses were tested slowly and one at a time.
Analysis
I collapsed the cluster installation into a local docker-compose, keeping whatever affects memory behaviour: container limits and the environment variables that drive the allocator. The reproduction criterion was set up front and measurably — the limit exceeded within minutes under load, not "it seems to be growing". Load came from the large-body profile, which is where the leak showed. Then heap profiles through pprof, taken over time and compared against each other: that is what separates "the component allocates a lot" from "the component does not give memory back".
Fixes
I reduced the profile to a specific place in the code and handed the component owner a report with pointed recommendations for that place, not "go look for a leak". The owner of the code made the change — that is the right split: reproduction, localisation and confirmation are mine.
Verification
A retest on the same bench with the same profile, compared before and after against the same criterion. The hypothesis-check cycle went from hours on a cluster to minutes on a laptop, and the reproduction bench stayed as an asset: a regression in that place can be checked at any time.