title: I have enough memory but mmap keeps failing saying Cannot allocate memory
body: <p>I am trying to <code>mmap</code> some large files but failed : I can't mmap any file that's larger than around 2.7 GB.</p>
  
  <p>By doing <code>ulimit -a</code>, it says my virtual memory is unlimited. I then did <code>cat /proc/meminfo</code> it says my system has 3GB Memfree and 2GB Swapfree. </p>
  
  <p>I am assuming I could mmap a file up to 5GB. I tried everything I learned on the internet, including using <code>MAP_NORESERVE</code> flag and set <code>overcommit_memory</code> to <code>1</code>. It's still the same, <code>Cannot allocate memory</code>. What could possibly go wrong?</p>
  
  <p>I am using 64 bit cpu and a 32 bit linux system. Please let me know if you need anymore information. I would really appreciate any advice or tips.</p>