title: bash error code 137 vs 1 when out of memory
body: <p><strong>Context</strong></p>
  
  <p>I run the following command in linux bash : </p>
  
  <pre><code>mono --debug --debugger-agent=transport=dt_socket,address=198.178.155.198:10000 ./Stress.exe
  </code></pre>
  
  <p>Stress.exe is a C# application.</p>
  
  <p><strong>What happens</strong></p>
  
  <p>At one point the system is out of memory, which is wanted. An error code is returned.</p>
  
  <p><strong>Error code returned (echo $?)</strong></p>
  
  <p>Code 1 : When my program creates a throw because it's out of memory.</p>
  
  <p>Code 137 : When it is killed by OS when overloading memory.</p>
  
  <p><strong>Question</strong></p>
  
  <p>Why is it sometime the OS that kills my application? Why is the result not always the same?</p>