title: 'Cannot allocate memory' (errno=12)' errors during runtime of Java application
body: <p>While running a distributed application, I get a lot of these errors on the server as well as on the worker nodes:</p>
  
  <pre><code>Java HotSpot(TM) 64-Bit Server VM warning: INFO: os::commit_memory(0x00007f4f8c800000, 549453824, 2097152, 0) failed; error='Cannot allocate memory' (errno=12)
  </code></pre>
  
  <p>Most of the time the process continues and finishes as expected but sometimes the process also fails.</p>
  
  <p>I am calling my application with <code>java -Xms512M -Xmx50G -cp myjar.jar myclass.Main</code></p>
  
  <p>The nodes have 128 GBs of RAM where about 120 GBs are free.</p>
  
  <p>I'm using the Oracle JVM:</p>
  
  <pre><code>$ java -version
  java version "1.7.0_45"
  Java(TM) SE Runtime Environment (build 1.7.0_45-b18)
  Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode)
  </code></pre>
  
  <p>What do these messages mean and how can I get rid of them?</p>