title: Memory usage when files are loaded via mmap()
body: <p>Wanted to know what if there is a relationship between the maximum amount of memory that can be used to map a file through mmap() and the size of the RAM in a linux box. I tried to memory map some files , and I found that I am not able to map any more files when the &quot;Mapped&quot; usage comes close to the &quot;MemTotal&quot; ( viewed via cat /proc/meminfo).</p>
  <blockquote>
  <p>From /proc/meminfo on the 64 bit linux box :</p>
  <p>MemTotal:     32909628 kB</p>
  <p>MemFree:        221744 kB</p>
  <p>Buffers:          1800 kB</p>
  <p>Mapped:       31642928 kB</p>
  <p>CommitLimit:  38012616 kB</p>
  <p>Committed_AS: 42641120 kB</p>
  <p>VmallocTotal: 536870911 kB</p>
  <p>VmallocUsed:    299920 kB</p>
  <p>VmallocChunk: 536568999 kB</p>
  </blockquote>
  <p>So, am I right in assuming that the &quot;Mapped&quot; usage would never exceed the &quot;MemTotal&quot;. The confusion I have is I was of the opinion that the memory is always virtual when we mmap a file.</p>
  <p>Thanks!</p>