title: C++: Memory maps / Caching libraries?
body: <p><strong>Can anybody recommend a library that makes caching/memory maps easy-to-use?</strong></p>
  
  <p>Memory management is <em>not</em> the focus of my project - it is a last-minute issue I am running into.  Hence, I am looking for a relatively quick-and-easy fix rather than trying to learn all the details of caching and memory maps.</p>
  
  <p>I am looking for a library that will automatically (under-the-hood) write and load (cache) from a file.</p>
  
  <hr>
  
  <p>Ideally, I am looking for the following: I can simply access/insert/delete from a "map" without having to save/load from a file.  If my <code>std::map</code> is relatively small, than this is directly from the heap.  If my <code>map</code> becomes to large, then it is memory mapped, and all load/save (from the mmap file) functions are performed "under the hood", so that I still only hve to do  <code>mymap.find(whatever)</code> , etc.</p>
  
  <p>(Each node in my multi-processor program produces a large amount of computations.  When I try to <code>all_gather</code>, the program crashes.  No single node has enough memory to hold the results of all the nodes combined.  Thus, I am looking for some sort of memory map / caching strategy.)</p>
  
  <hr>
  
  <p>This is run on a supercomputer (so, OS = UNIX).  Each node has 16GB memory.  There is a scratch space (enormous space for writing temporary files) that uses eSATA.  (I envision effective memory mapping to this scratch space as a solution)</p>