title: What happens when you run out of ram with mlockall set?
body: <p>I am working on a C++ application that requires a large amounts of memory for a batch run.
  (> 20gb)</p>
  
  <p>Some of my customers are running into memory limits where sometimes the OS starts swapping and the total run time doubles or worse.</p>
  
  <p>I have read that I can use the mlockall to keep the process from being swapped out. What would happen when the process memory requirements approaches or exceeds the the available physical memory in this way?</p>
  
  <p>I guess the answer might be OS specific so please list the OS in your answer.</p>