httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ruediger Pluem <>
Subject Re: Apache memory usage
Date Sun, 09 Dec 2007 22:04:40 GMT

On 12/09/2007 10:03 PM, Stefan Fritsch wrote:
> Hi,
> On Monday 03 December 2007, Stefan Fritsch wrote:
>> But I found two locations where the creation of a new brigade could
>> be avoided:
>> - In buffer_output()/ap_old_write_filter(), it is possible to keep
>> the brigade around and reuse it after the next flush.
>> - In ap_http_chunk_filter(), a new brigade is created for every
>> flush bucket. But it is not really necessary if the flush bucket is
>> the last bucket in the brigade.
>> I don't know yet whether the saving is significant in practice. But
>> it saves two brigades on every combination of
>> ap_rwrite()/ap_rflush() and mod_php uses ap_r*() quite a lot.
>> A patch is attached. It's against 2.2.6 but applies to trunk.
> I now got a report that this patch helped in one case where the system 
> used to run out of memory pretty quickly [1]. Could someone please 
> review the patch? Maybe it's not too late for 2.2.7 yet?

Your first patch to chunk_filter.c seems reasonable to me (committed
in r602735, to trunk).
Thanks for this good catch.

But I think your patch to server/protocol.c can be done much simpler.
Can you try the following and let us know if this helps as well:

Index: server/protocol.c
--- server/protocol.c   (Revision 602730)
+++ server/protocol.c   (Arbeitskopie)
@@ -1397,9 +1397,7 @@
          * can simply insert our buffered data at the front and
          * pass the whole bundle down the chain.
-        APR_BRIGADE_CONCAT(ctx->bb, bb);
-        bb = ctx->bb;
-        ctx->bb = NULL;
+        APR_BRIGADE_PREPEND(bb, ctx->bb);

     return ap_pass_brigade(f->next, bb);



View raw message