Quick Answer
Soft limits are advisory รขโฌโ the container can exceed them temporarily (memory soft limit = memory.soft_limit_in_bytes). Hard limits are enforced รขโฌโ the kernel kills processes that exceed them (memory hard limit = memory.limit_in_bytes). Docker's --memory flag sets the hard limit; --memory-reservation sets the soft limit.
Answer
Soft limits may be exceeded temporarily; hard limits cannot be exceeded.
S
SugharaIQ Editorial Team
Verified Answer
This answer has been peer-reviewed by industry experts holding senior engineering roles to ensure technical accuracy and relevance for modern interview standards.