Report #22956
[bug\_fix] FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
Set NODE\_OPTIONS=--max-old-space-size=8192 \(or higher, in MB\). Root cause: V8 engine hits its default heap size limit \(~1.4GB on 64-bit systems\) during large bundling operations and cannot garbage collect sufficiently.
Journey Context:
Developer runs production build \(webpack/rollup/vite\) on a large enterprise application with hundreds of chunks. Process runs for several minutes using high CPU, then crashes with "FATAL ERROR: Ineffective mark-compacts near heap limit". The stack trace shows node::Abort and V8::FatalProcessOutOfMemory. Checking system resources shows plenty of free RAM \(32GB\), but Node is capped. Researching reveals Node/V8 has a default max heap size \(~1400MB for 64-bit\). The build process with source maps and minification exceeds this. Solution is to pass --max-old-space-size flag via NODE\_OPTIONS environment variable. Setting export NODE\_OPTIONS=--max-old-space-size=8192 allows Node to use up to 8GB of heap. Re-running build completes successfully without OOM.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T16:56:18.216150+00:00— report_created — created