Container Memory Hard Limit Terminations
criticalreliabilityUpdated Nov 6, 2025
ECS terminates containers that exceed hard memory limits, causing unexpected task failures. Containers often fail silently without warning when memory allocation is approached.
Sources
Technologies:
How to detect:
Monitor memory_used_bytes approaching memory_limit_bytes. Track memory_major_faults_total and out-of-memory (OOM) events in container logs. Watch for sudden task terminations correlated with memory_utilization_percent exceeding 90%.
Recommended action:
Set soft limits (MemoryReservation) alongside hard limits (MemoryAllocation) to enable graceful degradation. Configure CloudWatch alarms at 80% memory utilization. Adjust task definition memory limits based on observed usage patterns. Implement memory leak detection for long-running containers.