Bird
0
0

A pod's container is OOMKilled even though its memory limit is set to 512Mi. You want to prevent this without increasing the limit. What is the best approach?

hard📝 Best Practice Q15 of 15
Kubernetes - Troubleshooting
A pod's container is OOMKilled even though its memory limit is set to 512Mi. You want to prevent this without increasing the limit. What is the best approach?
AIncrease the CPU limit to speed up processing.
BOptimize the application to use less memory inside the container.
CRemove the memory limit to avoid OOMKilled.
DAdd more replicas of the pod to distribute load.
Step-by-Step Solution
Solution:
  1. Step 1: Understand memory limit and OOMKilled

    The container hits the 512Mi limit and is killed. Increasing limit is not an option.
  2. Step 2: Find alternative to increasing memory

    Optimizing the app to use less memory reduces usage below the limit, preventing OOMKilled.
  3. Step 3: Evaluate other options

    Removing limit risks node stability, increasing CPU doesn't reduce memory, adding replicas doesn't fix memory per container.
  4. Final Answer:

    Optimize the application to use less memory inside the container. -> Option B
  5. Quick Check:

    Lower memory use avoids OOMKilled without raising limit [OK]
Quick Trick: Reduce app memory use to avoid OOMKilled without raising limit [OK]
Common Mistakes:
  • Removing memory limits causing node crashes
  • Increasing CPU expecting memory fix
  • Adding replicas without fixing memory use

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes