Skip to main content
All of the catalog
Injectable fault

OOMKilled: memory limit too low

The pager says go-api is being killed and restarted over and over. It came up clean and served fine for a minute, then the restart count started climbing and the service began flapping. Nothing was deployed.

ResourcesHigh severitygo-api/go-api
Definition on GitHub

Which app it breaks

go-api by default. Pass --app to break another app in your lab instead.

The hint ladder

Each hint narrows the search a little further. They are collapsed on purpose: open one only when you are properly stuck, because working out the next command yourself is the whole exercise.

Hint 1

The pods are restarting on a loop. kubectl get pods -n go-api shows climbing RESTARTS, but why are they dying? kubectl describe pod and read the container's Last State carefully.

Hint 2

Last State: Terminated, Reason: OOMKilled, Exit Code: 137. The kernel is killing the container for exceeding its memory limit. So what is the limit? Check the deployment's resources block.

Hint 3

The limit was cut to just above what the container uses at rest: enough to start on and idle on, which is why nothing looked wrong for the first minute, but not enough to serve requests. Read the number off the deployment itself rather than assuming one, then compare it with what the app actually uses under load (Grafana's container memory panels, or kubectl top pod -n go-api while the load is running) and raise the limit above that peak.

Further reading

Get updates

New scenarios and faults, release notes, and news about hosted labs if and when there is some. A few emails a month at most.

We'll email you about new releases, new lab content and paid offerings such as hosted labs, courses and workshops. Unsubscribe any time.