What is being told in here, is that:

foreach my $m (1..1e7 ) {
   my @array;

   foreach my $n (1..1e7 ) {
       push @array, $n;
   }

   print "in\n";
}

print "sleeping\n";
sleep 600;

Stops growing in memory.

In normal execution, when the memory is no longer used, the OS will cache it.

Best Regards
Marcos

On Thu, May 19, 2011 at 14:26, Shawn H Corey <shawnhco...@ncf.ca> wrote:
> On 11-05-19 01:39 AM, Sheppy R wrote:
>>
>> how would you change the original code to get it to free up memory?
>
> Put the processing in a sub-process.  When it dies, the memory is returned
> to the system.
>
> See:
> perldoc -f fork
> perldoc perlipc
>
>
> --
> Just my 0.00000002 million dollars worth,
>  Shawn
>
> Confusion is the first step of understanding.
>
> Programming is as much about organization and communication
> as it is about coding.
>
> The secret to great software:  Fail early & often.
>
> Eliminate software piracy:  use only FLOSS.
>
> --
> To unsubscribe, e-mail: beginners-unsubscr...@perl.org
> For additional commands, e-mail: beginners-h...@perl.org
> http://learn.perl.org/
>
>
>



-- 
Marcos Rebelo
http://www.oleber.com/
Milan Perl Mongers leader https://sites.google.com/site/milanperlmongers/
Webmaster of http://perl5notebook.oleber.com

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to