Most “random” container crashes are not random at all — they’re OOM kills.
By default, Docker containers have no memory awareness unless you explicitly define it.
services:
api:
image: my-api
deploy:
resources:
limits:
memory: 512M
Why this matters
Without limits, the container can consume host memory freely.
Linux kernel steps in → kills your container → zero logs → chaos.
Pro Tip
Always pair memory limits with application-level GC tuning (.NET, Java, Node).
