httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ruediger Pluem <rpl...@apache.org>
Subject Re: Memory usage, core output filter, and apr_brigade_destroy
Date Sun, 13 Sep 2009 16:03:23 GMT


On 09/13/2009 05:12 PM, Jim Jagielski wrote:
> 
> On Sep 13, 2009, at 8:48 AM, Ruediger Pluem wrote:
> 
>>
>>
>> On 09/13/2009 01:11 PM, Stefan Fritsch wrote:
>>> Hi,
>>>
>>> http://httpd.apache.org/docs/trunk/developer/output-filters.html
>>> recommends to reuse bucket brigades and to not use apr_brigade_destroy.
>>> However, both in 2.2 and in trunk, the core output filter sometimes
>>> calls apr_brigade_destroy on brigades that it has received down the
>>> chain from earlier output filters. Is this not bound to cause problems
>>> since the brigade's pool cleanup is then removed but the brigade is
>>> still reused later on?
>>
>> It could be. But the questions is if it is really reused later on.
>>
>>>
>>> Also, the core output filter often creates new brigades instead of
>>> reusing an existing brigade. This should also be changed to reduce
>>> memory usage, shouldn't it?
>>
>> Yes. That was the reason for adding apr_brigade_split_ex to apr-util 1.3.
>> But so far nobody has found time to get through the current httpd code
>> and improve the needed sections by using it.
>>
>>>
>>> For trunk, the attached patch at least keeps the temporary brigade for
>>> flush buckets around. Do the versioning rules allow to add elements to
>>> core_output_filter_ctx for 2.2.x, too? It's defined in httpd.h.
>>
>> Yes, if you add it to the end of the struct. Then only a minor bump is
>> required which is allowed. The other possibly more formal problem is
>> that we currently do not require apr / apr-util 1.3 for httpd 2.2.x
>> but only
>> 1.2. But after shipping 2.2.x for more then one year with apr /
>> apr-util 1.3
>> without problems I guess we can change this and require apr / apr-util
>> 1.3
>> for the next 2.2.x release.
>>
>> But your patch is causing core dumps during the proxy tests when
>> running the test suite :-(.
>> I currently don't understand why.
>>
> 
> Hmmm... either ctx->tmp_flush_bb is NULL or, since it was added in the
> middle of the struct, you didn't do a make distclean 1st....

That is not the problem. I did a slightly modified patch that added it to the
end. I suppose it has something to do with not matching pools or bucket
allocators between bb and ctx->tmp_flush_bb.
It fails on in the proxy case and in the proxy case we have some mixtures going
on there regarding pools and bucket allocators caused by the pooled backend
connections.


Regards

RĂ¼diger


Mime
View raw message