Docker and CI/CD · Senior · Question 21 of 75
Why can a container's memory usage appear high even when the app's heap is small?
- 1Docker reserves twice the limit for every container
- ✓Correct answer: The cgroup also counts page cache, buffers and native memory
- 3Heap metrics in Node are always reported as half
Explanation
File cache is reclaimable, but the working set (what OOM decisions use) includes more than the JS heap. Look at RSS and working set, not just heap stats.