简体   繁体   中英

How to set memory limit to NodeJS running with forever

I'm running my Node JS process through forever as below:

sudo forever start -o out.log -e error.log myServer.js

I want to change the memory limit of my NodeJs server as I do like below when I'm running it purely with node.

node --max-old-space-size=512 myServer.js

How I can do the same when I'm running it with forever? Is there some way like 'forever start --max-old-space-size=512'

You can pass node options by changing the command (which defaults to "node").

So for example:

sudo forever start -c "node --max_old_space_size=512" -o out.log -e error.log myServer.js

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM