>if a variable within a modperl program is created whether a reference to an
>object or just a var, does mod_perl know when to clean it up or should you
>do that yourself at the end
>
>i.e
>
>$main::var="LARGE STRING"


>does mod_perl know that the var is nolonger in use after the script has
>run??

No. On the contrary, $main::var, as a package-level variable, will retain
its value and remain in the child.

>One of the main reason for the enquiry is the use of selectall_arrayref
via
>DBI
>We currently use this as most of the selects return a small number of rows,
>but occasional the number of rows returned may be large.


Maybe there is yet a better way to handle it, but what I do is stock it in a
lexical variable in a subroutine:

sub x
    {
    my $x = ...
    }

There was however a discussion on memory leaks in such cases, or did I miss
the final conclusion?

Victor.

Reply via email to