title: Node JS app crashing itself even after using forever JS
body: <p>I am just tired of seeing my server goes down every time off and on.. Whenever I wake up it is down. Every time I have to go to SSH and then run </p>
  
  <pre><code>forever restartall 
  </code></pre>
  
  <p>to restart my node app :( </p>
  
  <p>I looked into the log file of forever and it says this</p>
  
  <pre><code>error: Forever detected script was killed by signal: SIGKILL
  error: Script restart attempt #1
  </code></pre>
  
  <p>I have absolutely no idea why is this happening.</p>
  
  <p>I am even running a cron job after every 50 minutes to auto restart node js in case it went down itself</p>
  
  <pre><code>0,50 * * * * * forever restartall
  </code></pre>
  
  <p>My app is running on Ubuntu EC2 AWS. And I use the following command to start my node app using forever:</p>
  
  <pre><code>forever -m5000 -w start index.js
  </code></pre>
  
  <p>Also, here are some recent snap of syslog since this happened recently</p>
  
  <pre><code>Jun  1 12:50:01 ip-172-31-28-35 CRON[25924]: (ubuntu) CMD (forever restartall)
  Jun  1 12:50:01 ip-172-31-28-35 CRON[25923]: (CRON) info (No MTA installed, discarding output)
  Jun  1 13:00:01 ip-172-31-28-35 CRON[25930]: (ubuntu) CMD (forever restartall)
  Jun  1 13:00:01 ip-172-31-28-35 CRON[25929]: (CRON) info (No MTA installed, discarding output)
  Jun  1 13:05:50 ip-172-31-28-35 dhclient: DHCPREQUEST of 172.31.28.35 on eth0 to 172.31.16.1 port 67 (xid=0x58e67545)
  Jun  1 13:05:50 ip-172-31-28-35 dhclient: DHCPACK of 172.31.28.35 from 172.31.16.1
  Jun  1 13:05:50 ip-172-31-28-35 dhclient: bound to 172.31.28.35 -- renewal in 1415 seconds.
  Jun  1 13:09:01 ip-172-31-28-35 CRON[26000]: (root) CMD (  [ -x /usr/lib/php5/maxlifetime ] &amp;&amp; [ -x /usr/lib/php5/sessionclean ] &amp;&amp; [ -d /var/lib/php5 ] &amp;&amp; /usr/lib/php5/sessionclean /var/lib/php5 $(/usr/lib/php5/maxlifetime))
  Jun  1 13:17:01 ip-172-31-28-35 CRON[26016]: (root) CMD (   cd / &amp;&amp; run-parts --report /etc/cron.hourly)
  Jun  1 13:20:01 ip-172-31-28-35 CRON[26023]: (ubuntu) CMD (/home/ubuntu/cron/serv.sh)
  Jun  1 13:20:01 ip-172-31-28-35 CRON[26022]: (CRON) info (No MTA installed, discarding output)
  Jun  1 13:29:25 ip-172-31-28-35 dhclient: DHCPREQUEST of 172.31.28.35 on eth0 to 172.31.16.1 port 67 (xid=0x58e67545)
  Jun  1 13:29:25 ip-172-31-28-35 dhclient: DHCPACK of 172.31.28.35 from 172.31.16.1
  Jun  1 13:29:25 ip-172-31-28-35 dhclient: bound to 172.31.28.35 -- renewal in 1560 seconds.
  Jun  1 13:34:39 ip-172-31-28-35 crontab[26289]: (ubuntu) LIST (ubuntu)
  </code></pre>
  
  <p>Here is the snapshot of the <code>free-h</code> command on my terminal of Ubuntu:
  <a href="https://i.stack.imgur.com/YjFqh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YjFqh.png" alt="enter image description here"></a></p>
  
  <p>and here is snapshot of <code>df -h</code> command:
  <a href="https://i.stack.imgur.com/IbgWI.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IbgWI.png" alt="enter image description here"></a></p>
  
  <p>Is there any way to fix this and diagnose why my app crashes itself? </p>
  
  <p><strong>LATEST EDIT AND LOGS AFTER FOLLOWING SUGGESTIONS:</strong>
  Uninstalled MySQL.
  Added SWAP.
  I added the uncaught exception code
  Now when I woke up today the server was again down and this is my forever log <a href="http://kl1p.com/AI01" rel="nofollow noreferrer">http://kl1p.com/AI01</a> and these r my free-h just after the crash and syslog screenshot <a href="https://snag.gy/WMzqL0.jpg" rel="nofollow noreferrer">https://snag.gy/WMzqL0.jpg</a>
  <a href="https://snag.gy/0wG8Dx.jpg" rel="nofollow noreferrer">https://snag.gy/0wG8Dx.jpg</a></p>
  
  <p>Can anyone please help what is causing the RAM to go fully used and why Node JS is causing errors, how to fix them?</p>