httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sam Carleton <scarle...@gmail.com>
Subject Re: Finding memory leaks in httpd and httpd modules
Date Tue, 16 Feb 2010 21:49:01 GMT
On Tue, Feb 16, 2010 at 2:35 PM, Kevac Marko <marko@kevac.org> wrote:

> On Tue, Feb 16, 2010 at 10:12 PM,  <mcqueenorama@gmail.com> wrote:
> > I have done a lot of c module development. I have found the same problem
> and wound up simply running the module under load while keeping an eye on
> memory usage.
> >
> > Use the pools. They are great and will keep you safe. Any other use of
> memory allocation should be very carefully considered.
> >
>
> Of course I am using pools, but using pools is not panacea, especially
> when non request pool is used :-)
>

I am in agreement with mcqueenorama.  I have not done a ton of module
programming, but what I have done is HEAVILY used by my app and core to the
whole thing.  My best advise is don't use the pools other then the request
pool unless you REALLY need to, even when the module is initializing there
is a temp pool which Apache clears after initialization.

I did run into a memory leak once that I found by simply checking all the
pool usages, it turned out I was using a server pool rather then a request
pool.

I NEVER use anything other then a pool for memory allocation.  The only
exception is 3rd party lib's that allocate memory, such as my usage of
SQLite, which I am sure allocates lots of memory, but I rely on it to clean
up that memory, assuming I manage the resource correctly.  To date, all runs
well!

Sam

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message