How to solve process out of memory in Node.js

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed — process out of memory
Same issue output with Node.js v6.7

node --max-old-space-size=1024 index.js #increase to 1gb
node --max-old-space-size=2048 index.js #increase to 2gb
node --max-old-space-size=3072 index.js #increase to 3gb
node --max-old-space-size=4096 index.js #increase to 4gb
node --max-old-space-size=5120 index.js #increase to 5gb
node --max-old-space-size=6144 index.js #increase to 6gb
node --max-old-space-size=7168 index.js #increase to 7gb
node --max-old-space-size=8192 index.js #increase to 8gb

--

--

--

Software Engineer / Ho Chi Minh City, Vietnam

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Vuong Tran

Vuong Tran

Software Engineer / Ho Chi Minh City, Vietnam

More from Medium

How to secure SPAs with Asgardeo

sanitizeEntity in Strapi v4

NPM commands

Introduction to Application Development: Client Layer