I am hosting a NodeJS app on a Ubuntu server. The server has 512 MB of RAM and is pretty basic since I am the only user of the app.
Recently, the app ended exited with the following errors:
npm ERR! code ELIFECYCLE
npm
ERR! errno 137
I looked up this error and it is due to lack of memory. I have now rebooted my server and restarted the app again. I ran the free -m command to see what my memory usage looks like. Here it is:
total used free shared buff/cache available
Mem: 475 239 27 0 208 219
Swap: 0 0 0
I am wondering if this a memory leak in my app or due to the server just being tight on memory with only 512 MB. I thought 512 MB would be enough since its basically not getting more than 1 request at a time (me).
Further, I am running my app using pm2 so is there a way to notify myself if the app exits again like this abnormally?
Thank you in advance for any solutions!