- Intermediate
- Memory and CPU
How it works
docker inspect -f '{{.State.OOMKilled}}' tells whether the container hit its own limit. Without limits, a leaking container grows until the whole server is short of memory, and the kernel may kill another process instead, often the database.
What breaks
A restart policy turns a memory leak into a series of short outages: killed, restarted, killed again. Limits keep the damage inside one service; fixing the leak or sizing the limit is still your job.
In a terminal
docker inspect -f '{{.State.ExitCode}} {{.State.OOMKilled}}' api
docker stats --no-stream
See it break, then fix it
Write the Dockerfile or the compose file, type the docker commands, and watch a simulated server run them through reboots, upgrades and traffic. Free to start.