问题
suddenly i received this error in my terminal.
[RangeError: Maximum call stack size exceeded]
I have used pm2 for it. And one of my process is restart autometically. Can you tell me why such happen? Or is there any other solutions for it? Please suggest me for it.
回答1:
you can increase the size of memory restart by doing below things
pm2 start process.js --max-memory-restart 2G (newer pm2 version)
pm2 start process.js --max-stack-size=65000" (older pm2 version)
And add below lines in your node.js file.
process.on('uncaughtException', function(err) {
console.log('Caught exception: ' + err);
console.log(err.stack);
});
for more detail : pm2
来源:https://stackoverflow.com/questions/38481726/pm2-process-crashed-on-server-it-gives-an-error