title: How to solve Memory Fragmentation
body: <p>We've occasionally been getting problems whereby our long-running server processes (running on Windows Server 2003) have thrown an exception due to a memory allocation failure.  Our suspicion is these allocations are failing due to memory fragmentation.</p>
  
  <p>Therefore, we've been looking at some alternative memory allocation mechanisms that may help us and I'm hoping someone can tell me the best one:</p>
  
  <p>1) Use Windows <a href="http://msdn.microsoft.com/en-us/library/aa366750.aspx" rel="noreferrer">Low-fragmentation Heap</a></p>
  
  <p>2) jemalloc - as used in <a href="http://en.wikipedia.org/wiki/Mozilla_Firefox_3" rel="noreferrer">Firefox 3</a></p>
  
  <p>3) Doug Lea's <a href="http://g.oswego.edu/" rel="noreferrer">malloc</a> </p>
  
  <p>Our server process is developed using cross-platform C++ code, so any solution would be ideally cross-platform also (do *nix operating systems suffer from this type of memory fragmentation?). </p>
  
  <p>Also, am I right in thinking that LFH is now the default memory allocation mechanism for Windows Server 2008 / Vista?...  Will my current problems "go away" if our customers simply upgrade their server os?</p>