【问题标题】:pm2 process crashed on server. it gives an errorpm2 进程在服务器上崩溃。它给出了一个错误
【发布时间】:2016-07-20 20:59:20
【问题描述】:

我的终端突然收到此错误。

[RangeError: Maximum call stack size exceeded]

我已经使用了 pm2。我的过程之一是自动重启。 你能告诉我为什么会这样吗? 或者有没有其他解决方案? 请给我建议。

【问题讨论】:

    标签: node.js ubuntu pm2


    【解决方案1】:

    您可以通过执行以下操作来增加内存重启的大小

    pm2 start process.js --max-memory-restart 2G (newer pm2 version)
    pm2 start process.js --max-stack-size=65000" (older pm2 version)
    

    并在您的 node.js 文件中添加以下行。

    process.on('uncaughtException', function(err) {
     console.log('Caught exception: ' + err);
     console.log(err.stack);
    });
    

    更多详情:pm2

    【讨论】:

    • 第二个选项我得到error: unknown option --max-stack-size'`
    猜你喜欢
    • 2016-04-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-09-01
    • 2012-04-26
    • 2020-11-04
    相关资源
    最近更新 更多