Node.jsexit code > 0

FATAL ERROR: JavaScript heap out of memory

$FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory

Analysis

The Node.js process has exhausted its allocated memory limit (default is around 1.5GB on 64-bit systems).

Common Triggers

  • Memory leak in the application.
  • Processing very large datasets/files in memory.

Debug Checks

  • $Monitor memory usage with process.memoryUsage().

Resolution

1
Increase the memory limit: node --max-old-space-size=4096 script.js (for 4GB).
2
Optimize code to stream data instead of loading it all into memory.