Alex Krohn wrote:

> Hi,
>
> With this simple test script:
>
> print "Content-type: text/html\n\n";
> my $var = 'x' x 500000;

our $var = 'x' x 500000;

>
> my $sub = sub { my $sub2 = sub { $var; }; };
> print "Done\n";
>
> $var does not get freed, and the process grows each request. Has anyone
> seen this sort of behavior and have any ideas/workarounds (besides don't

yes.  this is the documented behavior for closures.  the anonymous sub must
have it's own copy of $var which happens to be 500k plus perl overhead on each
invocation.

>
> do that).
>
> Cheers,
>
> Alex

--
___cliff [EMAIL PROTECTED]http://www.genwax.com/


Reply via email to