httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nick Kew <...@apache.org>
Subject Re: Generating a lot of data in content handler
Date Tue, 08 Dec 2009 14:34:52 GMT

On 8 Dec 2009, at 12:26, Kevac Marko wrote:

> Hello.
> 
> I am doing a lot of ap_rprintf(r, ...) in my content handler,
> generating more than tens of megabytes of data per request. I suppose
> all this data is kept in r->pool, which is freed after request. So if
> one user consume 20 MiB, hundred will consume 2 GiB.
> 
> How can I generate a lot of data without keeping all that data in
> r->pool till the end of request?

You can create your own pool as a subpool of r->pool, and
periodically clear the pool to flush data that have been sent
down the output chain.

Alternatively, if you can generate the data without reference
to a pool (e.g. in non-pool buckets, or with ap_rwrite & family),
the output brigades should deal with clearing it after use.

-- 
Nick Kew

Mime
View raw message