httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sander Striker <>
Subject Re: filtering huge request bodies (like 650MB files)
Date Thu, 11 Dec 2003 08:24:20 GMT
On Thu, 2003-12-11 at 07:44, Stas Bekman wrote:

> I now know what the problem is. It is not a problem in httpd or its filters, 
> but mod_perl, allocated filter struct from the pool. With many bucket brigades 
> there were many filter invocations during the same request, resulting in 
> multiple memory allocation. So I have to move to the good-old malloc/free to 
> solve this problem.
> Though it looks like I've found a problem in apr_pcalloc.
> modperl_filter_t *filter = apr_pcalloc(p, sizeof(*filter));
> was constantly allocating 40k of memory, whereas sizeof(*filter) == 16464
> replacing apr_pcalloc with apr_palloc reduced the memory allocations to 16k.
> Could it be a bug in APR_ALIGN_DEFAULT? apr_pcalloc calls APR_ALIGN_DEFAULT 
> and then it calls apr_palloc which calls APR_ALIGN_DEFAULT again, and probably 
> doubling the memory usage.

Woah!  I'll look into this.


View raw message