Stas,
I tried the latest version this morning, and it doesn't appear to have
made a great deal of difference. I'm not sure whether it consumes memory
as fast, however, as you said, there are leaks elsewhere. The following
code reproduces it.
====================================================================
#file:Test/BigFileTest2.pm
#---------------------------
#
# Version: 0.1.002
# Author: Chris Pringle
# Date of last update: 10/12/2003
# Copyright (C) 2003 Hewlett Packard Limited
#
package Test::BigFileTest2;
use strict;
use warnings;
use Apache::Filter();
use Apache::RequestRec();
use Apache::Connection();
use APR::Table();
use Apache::Const -compile => qw(OK);
use Apache::Const -compile => qw(DECLINED);
sub handler
{
# Get the filter object
my($f,$bb) = @_;
# Only done on the FIRST pass of the filter
unless($f->ctx)
{
$f->r->headers_out->unset('Content-Length');
$f->ctx('');
}
return Apache::DECLINED;
} # handler
1;
====================================================================
I tested it with the same 650MB ISO image, and it consumes more and more
memory until the box falls over (my watchdog kills it before it gets
that far! :) ).
Lastly, why does the memory continue to be consumer after the client has
terminated the connection?
Thanks for your help.
---
Regards,
Chris Pringle
UK PSG
Hewlett-Packard, Bristol
Tel: +44 117 31 29664
> -----Original Message-----
> From:
> [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]
> org] On Behalf Of Stas Bekman
> Sent: 10 December 2003 02:04
> Cc: Pringle, Chris (HP-PSG); [EMAIL PROTECTED]
> Subject: Re: [mp2] Memory Leak
>
>
> Stas Bekman wrote:
> > Pringle, Chris (HP-PSG) wrote:
> >
> >> Hi,
> >>
> >> Apologies for it not being in the correct format.
> >
> >
> > I wasn't after format but the information ;)
> >
> >> Below is a small section of code that I'm having problems with.
> >
> >
> > Thanks for the code sample. It allowed me to single out the guilty
> > element, which was $f->ctx (I think), which leaks as you
> have observed.
> > I'll keep you posted once I've fixed it.
>
> Chris, please try with the current cvs, the f->ctx leak is
> now gone.
> http://perl.apache.org/download/source.html#Development_mod_pe
rl_2_0_Source_Distribution
I see that mp2 slowly consumes more memory on each request, but I didn't
have
a chance to investigate whether it's due to another leak or just the
normal
unsharing. I suppose there can be another small leak or two somewhere,
but
unrelated to the leak you've detected. If someone can track them down
it'd be
a great help.
__________________________________________________________________
Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org http://ticketmaster.com
--
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
--
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html