title: java.io.IOException: error=12, Cannot allocate memory
body: <p>On one of the machines, my app throws exception   </p>
  
  <pre><code> Caused by: java.io.IOException: error=12, Cannot allocate memory
      at java.lang.UNIXProcess.forkAndExec(Native Method)
      at java.lang.UNIXProcess.&lt;init&gt;(UNIXProcess.java:247)
      at java.lang.ProcessImpl.start(ProcessImpl.java:134)
      at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
      ... 7 more
  </code></pre>
  
  <p>Based on the error message it is doing a fork and getting OOM, which this article describes clearly and provides some fix. <a href="http://www.bryanmarty.com/2012/01/14/forking-jvm/" rel="nofollow noreferrer">http://www.bryanmarty.com/2012/01/14/forking-jvm/</a>
  I have 32 GB ram on that box, and 16 GB on the other. On this host, I don't have swap, but on the 16 GB box, I have swap space.The process runs on 16 GB box, but not on this one. Now, the question is, do I really need swap space even when I have enough RAM? What else can be the cause of that problem?</p>