[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Memory leak?



"Strider" <Strider@clarityconnect.com> said the following at 12/8/97 2:29 
PM:

>foreach $user ( keys %data ) {
>	foreach $date ( keys %{ $data{$user} } ) {
>			$output .= "$user\t$date\t$data{ $user }{ $date }\n";
>	}
>}
>
>open (OUT, ">nodup.tab");
>print OUT $output;
>close OUT;

This part would put essentially close to two copies of the data in memory 
since you are appending things to $output.

Also, $data will contain another essentially complete copy of the 
database as well.

something like this will help a bit:

open (OUT, ">nodup.tab");
foreach $user ( keys %data ) {
	foreach $date ( keys %{ $data{$user} } ) {
			print OUT "$user\t$date\t$data{ $user }{ $date }\n";
	}
}
close OUT;

also, just buy more ram....its cheap these days. ;-)

-jon

***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch