<br><br><div class="gmail_quote">On Tue, Mar 30, 2010 at 12:04 AM, Greg A. Woods <span dir="ltr">&lt;<a href="mailto:woods-cyrus@weird.com">woods-cyrus@weird.com</a>&gt;</span> wrote:<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
A memory leak is memory consumption by a computer program where the<br>
program is unable to release memory it has acquired.<br>
<br>
On a code path that definitively always ends with exit(2), all memory<br>
is, by definition, released.  Therefore there is no &quot;leak&quot; possible on<br>
any sure code path to exit().<br>
<br>
Relying on memory profilers which primarily try to determine memory<br>
leaks by reporting on unreleased memory left at the time of the exit()<br>
call is a fallacy sure to waste a lot of maintenance and coding time.<br>
<br>
The only time memory leaks are actually important is when the program<br>
continues to run!  Ideally the memory profiler must be triggered to<br>
report unreleased memory at the time the program restarts its main loop<br>
of execution in order to generate useful reports of unreleased memory.</blockquote><div><br></div><div><br></div><div>Relying on exit freeing up memory is pretty lazy as it prevents switching to threads. </div><div>Valgrind reports memory hold at exit time as a leak and I think it&#39;s a good thing.</div>
<div><br></div><div>I&#39;m only a java programmer using cyrus for its webmail need by I think that fork/leak/leak/exit is a bad programming model.</div><div><br></div></div>