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.
Bes
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.0002 million dollars worth,
Shawn
Con