Dave,
    Perhaps this is why.... from the eagle book,
    "During the child exit phase, mod_perl invokes the Perl API function 
perl_destruct( ) to run the contents of END blocks and to invoke the 
DESTROY method for any global objects that have not gone out of scope 
already."
    So I think i'm right in saying that, "When I run this, the DESTROY 
method is not called until the server shuts down." is perfectly normal 
behaviour. I don't know how you are actually testing your "memory 
usage", but I might suggest that if you are sending larger amounts of 
data than previously, just once per 5000 requests then this memory is 
gonna be consumed by apache forever (at least until httpd is killed).

Richard


Dave Rolsky wrote:

>It looks like there may be a memory leak with Apache::Request.  I'm using
>version 1.0 with Perl 5.6.1, mod_perl 1.26, and Apache 1.3.26.  mod_perl
>is statically compiled into Apache.
>
>Here's some code that I think demonstrates the leak:
>
>  package My::APRTest;
>
>  use strict;
>
>  use Apache::Request;
>  sub Apache::Request::DESTROY{warn "DEAD: $_[0]\n"}
>  sub handler
>  {
>      my $r = shift;
>      $r = Apache::Request->new($r);
>
>      $r->send_http_header;
>      $r->print('apr test');
>
>      return 200;
>  }
>
>  1;
>
>When I run this, the DESTROY method is not called until the server shuts
>down.
>
>Watching memory using with top (against a server running as httpd -X) I
>can see that memory usage is growing a little less the 500K every 5000
>requests.
>
>This isn't catastrophic but fixing it would be a good thing.
>
>
>-dave
>
>/*==================
>www.urth.org
>we await the New Sun
>==================*/
>
>
>
>  
>


Reply via email to