Re: [patches] avoid unless exit()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On Tue, Mar 30, 2010 at 12:04 AM, Greg A. Woods <woods-cyrus@xxxxxxxxx> wrote:
A memory leak is memory consumption by a computer program where the
program is unable to release memory it has acquired.

On a code path that definitively always ends with exit(2), all memory
is, by definition, released.  Therefore there is no "leak" possible on
any sure code path to exit().

Relying on memory profilers which primarily try to determine memory
leaks by reporting on unreleased memory left at the time of the exit()
call is a fallacy sure to waste a lot of maintenance and coding time.

The only time memory leaks are actually important is when the program
continues to run!  Ideally the memory profiler must be triggered to
report unreleased memory at the time the program restarts its main loop
of execution in order to generate useful reports of unreleased memory.


Relying on exit freeing up memory is pretty lazy as it prevents switching to threads. 
Valgrind reports memory hold at exit time as a leak and I think it's a good thing.

I'm only a java programmer using cyrus for its webmail need by I think that fork/leak/leak/exit is a bad programming model.

----
Cyrus Home Page: http://cyrusimap.web.cmu.edu/
Cyrus Wiki/FAQ: http://cyrusimap.web.cmu.edu/twiki
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html

[Index of Archives]     [Cyrus SASL]     [Squirrel Mail]     [Asterisk PBX]     [Video For Linux]     [Photo]     [Yosemite News]     [gtk]     [KDE]     [Gimp on Windows]     [Steve's Art]

  Powered by Linux