Docker and CI/CD · Middle · Question 20 of 75
Why may Node.js ignore a container's memory limit and get OOM-killed?
- 1Docker turns off garbage collection inside containers
- 2Node never uses more memory than one hundred megabytes
- ✓Correct answer: The heap limit might not match the container limit, so set it
Explanation
Recent Node versions read cgroup limits, but heap is only part of the memory. Tune --max-old-space-size and leave headroom for buffers and native memory.