Skip to content

Instantly share code, notes, and snippets.

View andrexx's full-sized avatar

Andrii Chumak andrexx

View GitHub Profile
@andrexx
andrexx / tips_increase_memory_limit_nodejs.js
Created April 8, 2018 22:12 — forked from motss/tips_increase_memory_limit_nodejs.md
[TIPS] Increase memory limit in Node.js
// 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.
node --max_old_space_size=1024 server.js // increase to 1gb
node --max_old_space_size=2048 server.js // increase to 2gb
node --max_old_space_size=3072 server.js // increase to 3gb
node --max_old_space_size=4096 server.js // increase to 4gb
node --max_old_space_size=5120 server.js // increase to 5gb
node --max_old_space_size=6144 server.js // increase to 6gb