in reply to Does using globals via our() in mod_perl scripts lead to apache child size growth?

Globals will use up as much space as the largest thing you ever put in them. So will lexicals. Be careful about putting something really big (e.g. slurping a file) into any variable in a persistent Perl environment, because the memory will not be returned.
  • Comment on Re: Does using globals via our() in mod_perl scripts lead to apache child size growth?

Replies are listed 'Best First'.
Re^2: Does using globals via our() in mod_perl scripts lead to apache child size growth?
by Aristotle (Chancellor) on Nov 22, 2003 at 08:57 UTC
    I thought it does get returned eventually, nowadays? Might only happen when at midnight during high tide, but I seem to remember hearing the never-gets-released rule is no longer true.

    Makeshifts last the longest.

      Memory that is actually freed (which you can do by setting a variable to undef) gets returned to Perl for other uses and in some cases on some systems gets returned to the OS. If you don't explicitly undef, it stay allocated to the variable that used it.
        Does just letting it go out of scope count the same as explicit undef?

        Makeshifts last the longest.