title: Node.js Server with PM2 Crashing with error ENOMEM - but NO memory leak
body: <p>I have an EC2 instance running a node.js (v0.12.4) server with PM2 (v0.12.16).</p>
  
  <p>After deploying in a new environment, my service had started crashing almost instantly with <code>spawn ENOMEM</code> Errors like this one:</p>
  
  <p><a href="https://i.stack.imgur.com/4H29n.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4H29n.png" alt="spawn ENOMEM"></a></p>
  
  <p>Server logs do not indicate unusual activity. Diff from other environment is only config string such as DB hostname.</p>
  
  <p>I have started all possible monitoring on server but nothing shows. No higher memory of the process or the machine, and no peaks in CPU/RAM Usage.</p>
  
  <p>To be certain this is not a memory issue I have tried enlarging the instance from t2.micro to t2.large (2GB->8GB RAM), despite running the same process on a micro in a different environment. Still, the process crashes in a manner of minutes.</p>
  
  <p>I strongly believe this is <em>NOT</em> a memory leak, but might be some sort of a memory allocation problem. 8GB server monitoring shows 88~95% free memory, and it's stable around that area.</p>
  
  <p>Alos note, when that's the type of crash, oddly enough, PM2 will not pick up on the error, and won't restart the process, but I don't mind that, as I'm more interested in solving the actual issue.</p>
  
  <p>Has anyone encountered a problem as such?</p>
  
  <p>Any kind of help is appreciated.</p>