Re: mod_perl memory

Torsten Förtsch <[email protected]>
Newsgroups gmane.comp.apache.mod-perl
Message-ID <[email protected]>
On Tuesday 16 March 2010 21:09:33 Pavel Georgiev wrote:
> for (<some condition>) {
>     $request->print("--$this->{boundary}\n");
>     $request->print("Content-type: text/html; charset=utf-8;\n\n");
>     $request->print("$data\n\n");
>     $request->rflush;
> }
> 
> And the result is endless memory growth in the apache process. Is that what
>  you had in mind?
> 
I can confirm this. I have tried this little handler:

sub {
  my $r=shift;

  until( -e "/tmp/stop" ) {
    $r->print(("x"x70)."\n");
    $r->rflush;
  }

  return Apache2::Const::OK;
}

The httpd process grows slowly but unlimited. Without the rflush() it grows 
slower but still does.

With the rflush() its size increased by 100MB for an output of 220MB.
Without it it grew by 10MB for an output of 2.3GB.

I'd say it's a bug. 

Torsten Förtsch

-- 
Need professional modperl support? Hire me! (http://foertsch.name)

Like fantasy? http://kabatinte.net
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.