On Server startup exporting 2GB(Approximately) data from mongodb to redis,then getting error as FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - process out of mem
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - process out of mem
You can also set NODE_OPTIONS when running an npm script rather than node itself:
node
"scripts": { "start": "NODE_OPTIONS=--max-old-space-size=4096 serve", },