I use PM2 to keep my node.js (v4.2.3) server running forever. However, sometimes the process would restart for no apparent reason. There's nothing printed in the standard log or error log files.
When my server normally crashes, there are stacks printed indicating which line the crash errors. But this time, there's absolutely nothing printed in the log file, and this is happening about once per day.
This is so weird and frustrating since I can't even debug the reason it crashes. Does anyone know what might be the cause?
If you are running on linux, check for log messages in /var/log/messages
indicating your node process was killed by the linux Out of Memory Killer (OOM Killer). You can check with egrep -i 'killed process' /var/log/messages