pm2 process crashed on server. it gives an error

家住魔仙堡 提交于 2020-01-13 07:29:29

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!