title: Will malloc implementations return free-ed memory back to the system?
body: <p>I have a long-living application with frequent memory allocation-deallocation. Will any <code>malloc</code> implementation return freed memory back to the system?</p>
  <p>What is, in this respect, the behavior of:</p>
  <ul>
  <li>ptmalloc 1, 2 (glibc default) or 3</li>
  <li>dlmalloc</li>
  <li>tcmalloc (google threaded malloc)</li>
  <li>solaris 10-11 default malloc and mtmalloc</li>
  <li>FreeBSD 8 default malloc (jemalloc)</li>
  <li>Hoard malloc?</li>
  </ul>
  <h3>Update</h3>
  <p>If I have an application whose memory consumption can be very different in daytime and nighttime (e.g.), can I force any of <code>malloc</code>'s to return freed memory to the system?</p>
  <p>Without such return freed memory will be swapped out and in many times, but such memory contains only garbage.</p>