Node.js 20+ automatically adjusts heap size based on container memory limits through cgroup awareness. By default, heap size is 50% of container memory up to 4 Gi, maxing out at 2 GB. The --max-old-space-size flag can override these defaults. The article explains V8 garbage collection behavior, troubleshooting memory leaks, and

Table of contents
Node.js 20 inside a containerNode.js requests versus limitsNode.js memory managementV8 garbage collection behaviorDeploying Node.js 20 on OpenShiftTroubleshootingSummaryDemo videoConclusionSort: