By default the memory limit in Node.js is 512MB.
This will cause FATAL ERROR- JS Allocation failed – process out of memory when processing large data files.
It can be avoided by increasing the memory limit.
See Command-line options for more details.
node --max-old-space-size=1024 server.js # increase to 1gb