httpd-apreq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <s...@stason.org>
Subject Re: [PATCH] Re: Parsers test eats all the memory
Date Thu, 13 Jan 2005 03:00:45 GMT
Joe Schaefer wrote:
> Stas Bekman <stas@stason.org> writes:
> 
> 
> [...]
> 
> 
>>>I'm trying to rewrite the test to use sub-pools, so the memory is
>>>freed more often, but it seems that there are some leaks, so even
>>>when reducing the test to a very minimum, just a plain
>>>  apr_brigade_create(sp, apr_bucket_alloc_create(sp));
>>>leaks like crazy. so i'm still looking at it.
>>
>>This consumes 259MB:
> 
> 
> [...]
> 
> 
>>             bb = apr_brigade_create(sp, apr_bucket_alloc_create(sp));
>>             apr_brigade_destroy(bb);
>>
>>             apr_pool_destroy(sp);
> 
> 
> 
> I see the problem now.  The pool cleanup doesn't free the memory
> associated to apr_bucket_alloc_create; it just resets the allocator.
> There needs to be an associated apr_bucket_alloc_destroy call (before
> the pool is destroyed).
> 
> 
> 
>>Unless the leak happens only in the debug-enabled version of pool functions,
>>i.e. apr_pool_destroy doesn't free the memory. I suspect that this is the
>>case. going to look at the apr source code after dinner.
> 
> 
> The reason we don't see this without --enable-pool-debug is because
> the created allocator is shared (I think).   Here's a patch that 
> should fix the test suite; mod_apreq should be ok, but the cgi
> env may need a similar patch.  Please test.

Joe++, now requires only about 10MB.

-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

Mime
View raw message