On Thu, 12 Apr 2001, Tim Bunce wrote:

> On Wed, Apr 11, 2001 at 08:22:38PM -0700, Randal L. Schwartz wrote:
> > 
> > In an .htaccess, I place:
> > 
> >     Options +ExecCGI
> >     PerlFixupHandler "sub { -f $_[0]->filename and -x _ and 
>$_[0]->handler(q{cgi-script}) }"
> > 
> > Now any executable file in this directory (or below) is processed with
> > mod_cgi.  Any non-executable file is processed with whatever the MIME
> > engine came up with before.
> > 
> > OK, too cool to not pass on. :)
> 
> Except that I think you'll find that string is being recompiled for
> each request - slow and leaks memory. The principle is good though :)

Can you briefly explain why it leaks memory?

I have been playing with Apache::Leak and Devel::Leak trying to figure out
what is happening when Perl code leaks memory, but I haven't got my head
around it yet...

Also, a more general question to the list.  How reasonable is it to assume
that most of the more standard modules on CPAN don't leak memory when used
in a mod_perl environment?  For example DBI (not to pick on you Tim),
Data::Dumper, HTML::Parser or MD5 just to name some of the more common
modules.  Are there any modules that I should stay away from when using
mod_perl?

- Cees Hek

Reply via email to