Interview practice question
Java container killed despite heap limit
Backend Engineering · Language Runtimes · Intermediate
Your Java service in Kubernetes is OOM-killed even though -Xmx is set below the container's memory limit. Why?
What a strong answer covers
Your AI report card counts how many of these ideas you cover.
- JVM uses non-heap memory too.
- Metaspace, thread stacks, code cache, direct buffers.
- Leave headroom (heap ~ 60-75% of limit).
- Use MaxRAMPercentage.
- Native Memory Tracking to measure.
Practise this topic
Start without signing up. Sign in free to get an AI report card on your answer.