Just run your application with this flag. Example is for 8GB node --max-old-space-size=8192 server.js