httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cliff Woolley <>
Subject Re: Source of memory leak in mod_proxy?
Date Thu, 05 Sep 2002 05:17:14 GMT
On Wed, 4 Sep 2002, Justin Erenkrantz wrote:

> Will the buckets/brigade be cleaned up when the request_rec's
> pool is destroyed or are do they live as long as the connection
> pool?

Buckets live forever until you destroy them.

Brigades live as long as the pool they're in (normally r->pool) and
  automatically delete any buckets still in them when that pool cleans up

The bucket allocator will allocate as much memory as is needed for the
  maximum amount of simultaneously-alive buckets *ever*.  c->bucket_alloc
  is a pointer to an allocator that may live as long as the whole thread.

In other words, the easiest ways to leak memory with buckets are to take a
bunch of buckets out of their brigade and then forget about them, or leave
them in the brigade and then forget about the brigade, in which case
they'll at least get cleaned up when r->pool goes away, but that still
might result in a lot of buckets simultaneously allocated before the
request is done.  Or you could have a filter that buffers way more stuff
than it should, but that's usually a more obvious bug.

> I'm purposely *not* looking at the code as I'd like to know the
> intention rather than what we actually do.  =)  -- justin

Me too.  :)

Does the above help?


View raw message