Sunday 29 November 2015

Node.js limit ram usage

Hi,I have a VPS that has only 1gb of ram and I run a web scraper on it, but I run out of memory and I get "process is killed" error after a few minutes.How can I limit memory usage to, say, 512 mb?I found the command below but I couldn't make it work, I'm probably using it wrong. When I enter it on the terminal, my server doesn't start. I press CONTROL + C and press npm start to start my server, but I still run out of memory.node --max-executable-size=192 --max-old-space-size=256 --max-semi-space-size=2 app.js

Submitted November 29, 2015 at 01:36PM by laraveling

No comments:

Post a Comment