perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Clinton Gormley <>
Subject Re: huge httpd processes
Date Tue, 29 Sep 2009 22:16:56 GMT

> I tried undef'ing @data just before the return as it is no longer used
> but 
> this only gained me 1/2 Mb. I would have expected to get all 8Mbs
> back. I 
> don't understand why not.
Perl (as least on the OS's that I'm familiar with) doesn't release used
memory back to the OS.

Have a look at:

for more discussion on the matter.

But basically, try to avoid loading all that data in your mod_perl
> Also - in general terms if you do something like this (simplified):

> our $var;
> sub new() {
> $var = "hello world";
> }
> \Since the module containing the package MyClass is loaded into the 
> apache/mod_perl process does $var ever go out of scope once set? I
> think 
> not - and it's memory is never freed? if this is correct and I used
> my 
> instead even then would it go out scope ?

It wouldn't go out of scope because it's scope continues to exist until

There are good reasons for using variables at package level, but don't
use them if you don't have to.


View raw message