note
Nova
Hi nonk ,<br>
This theme seems to be quite common , memory gets eaten up and is not released .<br>
The issue is eroding my own confidence in proceeding to develop a perl based tool which I would like to be able to control the release of MEM , when not needed via the best possible code . <br>
On my NT PC / with Perl running under ActiveState , the following code eats up 92,608 KB MEM . After the undef
the MEM usage drops only to 90,572 KB MEM . An awefull lot
of Residual MEM is not returned to the O/S until the program exits . <br>
I know that I am pushing an anonymous array into X , but it really concerns me that undef is not reclaiming the MEM .
Can my code be modified to allow the MEM to be reclaimed to the O/S . I have not found a way <br>
Nova
<code>
#!perl
{
my $i=0 ;
my @X ;
while ( $i < 500000 ) {
push @X , [$i , $i , $i , $i ] ;
if ($i%10000==0) { printf "Index %-7d %-7d \n\n" , $i , $X[$i][2] ;}
$i++ ;
} ;
printf "Check MEM usage then Return to undef X" ;
<> ;
undef @X ;
};
printf "Enter Return to quit program" ;
<> ;
<\code>
642604
642604