To solve the process out of memory exception in Node.js we need to increase the
max-old-space-size
. By default the max size of max-old-space-size is 512 mb which you can increase by the command:
node --max-old-space-size=1024 file.js
Итог
Key takeaway for interview: How to solve "Process out of Memory Exception" in Node.js ?