If you get Fatal error js allocation failed - process out of memory when processing large datasets on NodeJS, you should increase memory limit. Learn how to.

Default memory limit is 512MB on 32bit systems and ~1.5GB on 64bit systems. Increase with

1
node --max-old-space-size=8192 script.js # 8gb memory limit

If you run Node in cluster mode, it’s still limit per process.