memory leak in httpd or child process (what is a memory leak)

Tim Writer tim-s/rLXaiAEBtBDgjK7y7TUQ at public.gmane.org
Sat Dec 24 18:09:26 UTC 2005


lsorense-1wCw9BSqJbv44Nm34jS7GywD8/FfD2ys at public.gmane.org (Lennart Sorensen) writes:

> On Tue, Dec 20, 2005 at 09:41:51PM -0500, Tim Writer wrote:
> > There are garbage collectors available for C, most notably the Boehm
> > Demers Weiser conservative garbage collector:
> > 
> >     http://www.hpl.hp.com/personal/Hans_Boehm/gc/
> > 
> > Also, many C++ programs use a weak form of garbage collection known as
> > reference counting.
> > 
> > Why more C/C++ developers (including myself) don't use garbage collection
> > more often is a bit of a mystery.
> 
> Probably because for some situations they don't work well, and sometimes
> you need to control when memory is freed, rather than at some arbitrary
> time chosen by the garbage collector.

But those constraints don't apply to the vast majority of programs. Also, the
Boehm Demers Weiser garbage collector doesn't preclude explicit use of
malloc() and free() so you can "have your cake and eat it too".

> It is certainly also possible to write code (arguably badly) in such a way
> that you are still considering it in use and know where it is, but the
> garbage collector thinks you are done with it.

Good tools don't prevent you from writing bad code.

> I prefer to know when things are freed and why.

A lot of programmers feel the same but don't have good facts or arguments to
back up their position.

The issues you've raised and more are dealt with here:

    http://www.hpl.hp.com/personal/Hans_Boehm/gc/issues.html

>  garbage collection is for scripting languages :)

Which is just one reason why most programmers are more productive with so
called scripting languages.

-- 
tim writer <tim-s/rLXaiAEBtBDgjK7y7TUQ at public.gmane.org>                                  starnix inc.
647.722.5301                                      toronto, ontario, canada
http://www.starnix.com              professional linux services & products
--
The Toronto Linux Users Group.      Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml





More information about the Legacy mailing list