apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <...@covalent.net>
Subject Re: Observations on fragmentation in SMS pools
Date Sun, 08 Jul 2001 17:01:41 GMT
On Sun, 8 Jul 2001, Ian Holsman wrote:

> Bill Stoddard wrote:
> >>I've been working on a power of 2 allocator.  I still haven't got that up
> >>to speed yet, but it is worth a look.  I'll play with it this week and post
> >>it to the list
> >>
> >
> >I hacked a simple power of two allocator together as a proof of concept that replacing
> >malloc/free with apr_malloc/apr_free could give us a performance boost (it does).
Find it
> >here (it is for Windows).
> >
> Hi Bill,
> I was wondering why the brigade code doesn't make use of pools/sms  to
> handle it's memory.
> It has a pool passed to it from what I can see...

Pools aren't used for brigades because when a pool is cleaned up, the
memory goes away.  This means that whenever we are doing a pipelined
request, and we allocate the brigade out of the request_rec, we would have
to copy all of the data into the conn_rec before we could destroy the
request.  If we allocate everything out of the conn_rec, then we have a
huge resource leak until the end of the connection.

For a complete description of why we don't use pools for brigades, please
take a look at the mailing list archives from the time period around when
the brigades were introduced.  This question was brought up MANY times,
and it has been answered in great detail.


Ryan Bloom                        	rbb@apache.org
Covalent Technologies			rbb@covalent.net

View raw message