Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save michaelhenrique182/f0606dc1d552a8c5251efa2df4a77c5c to your computer and use it in GitHub Desktop.
Save michaelhenrique182/f0606dc1d552a8c5251efa2df4a77c5c to your computer and use it in GitHub Desktop.
Node.JS ( & pm2 ) Process Memory Limit
# Plain Ol' Node
node --max_old_space_size=1024 app.js # increase to 1gb
node --max_old_space_size=2048 app.js # increase to 2gb
node --max_old_space_size=3072 app.js # increase to 3gb
node --max_old_space_size=4096 app.js # increase to 4gb
node --max_old_space_size=5120 app.js # increase to 5gb
node --max_old_space_size=6144 app.js # increase to 6gb
# For pm2
pm2 start app.js --node-args="--max_old_space_size=1024" # increase to 1gb
pm2 start app.js --node-args="--max_old_space_size=2048" # increase to 2gb
pm2 start app.js --node-args="--max_old_space_size=3072" # increase to 3gb
pm2 start app.js --node-args="--max_old_space_size=4096" # increase to 4gb
pm2 start app.js --node-args="--max_old_space_size=5120" # increase to 5gb
pm2 start app.js --node-args="--max_old_space_size=6144" # increase to 6gb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment