Bird
0
0

You run a container with:

medium📝 Troubleshoot Q6 of 15
Docker - Resource Management
You run a container with:
docker run --memory-reservation=200m myapp
But the container uses 300MB memory and is not killed. Why?
ABecause Docker ignores memory-reservation without a memory limit.
BBecause memory-reservation is a soft limit and does not kill the container.
CBecause the container has unlimited memory by default.
DBecause the container is using swap memory instead.
Step-by-Step Solution
Solution:
  1. Step 1: Recall memory-reservation behavior

    Memory reservation is a soft limit; exceeding it does not kill the container.
  2. Step 2: Understand absence of hard limit

    Without a hard memory limit, container can use more memory than reservation.
  3. Final Answer:

    Because memory-reservation is a soft limit and does not kill the container. -> Option B
  4. Quick Check:

    Soft limit exceeded = no kill [OK]
Quick Trick: Soft limit exceeded is allowed unless hard limit set [OK]
Common Mistakes:
  • Assuming reservation kills container
  • Thinking Docker ignores reservation without limit
  • Confusing swap usage with memory limits

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Docker Quizzes