httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Orton <jor...@redhat.com>
Subject Re: sed filter module
Date Wed, 14 Mar 2007 20:45:48 GMT
On Wed, Mar 14, 2007 at 06:38:48PM +0000, Nick Kew wrote:
> Now, what leads you to suppose mod_line_edit uses RAM proportional
> to content size?  Other than when the entire contents arrive in a
> single bucket?

Because it implements the naive filter implementation, equivalent to:

e = APR_BRIGADE_FIRST(bb);
while (e != APR_BRIGADE_SENTINEL(bb)) {
   apr_bucket_read(e, ...);
   ...process bucket without passing on to f->next or deleting...
   e = APR_BUCKET_NEXT(e);
}

for the general case given bb contains a single FILE bucket, or a 
CGI/PIPE bucket, or any morphing bucket type which doesn't represent a 
chunk of memory, this does:

After Iter#	Contents of bb			Heap memory used
1		HEAP FILE			8K
2		HEAP HEAP FILE			16K
3		HEAP HEAP HEAP FILE		24K
...
n		HEAP*n				n*8K

where n ~= file size / 8K; FILE buckets will also morph into MMAP 
buckets so the practice is a bit more complicated but this illustrates 
the point... and the 8K is really 8000 bytes.

joe

Mime
View raw message