I have opened a large (72 mb) file that i am parsing and loading into a hash. I then sort the hash and write it to a new text file. In the process I am receiving the following system error:
Out of memory during request for 1016 bytes, total sbrk() is 670351204 bytes!
Is this a memory leak? I have run this process over and over successfully but now all I receive is this error. Here is the code:
while (<DATAFILE1>) { chomp; ($account,$time,$dept,$dimset,$sched,$emp,$type,$val) = split( +/[{]/); $emp = empnumber ($emp); push(@{$employee{$dept.$account.$emp.$subctr}},($account,$time +,$dept,$dimset,$sched,$emp,$type,$val)); $subctr++; } close(DATAFILE1); foreach $empnum (sort keys(%employee)) { my ($account,$time,$dept,$dimset,$sched,$emp,$type,$val)= @{$em +ployee{$empnum}}; string2 = $account."{".$time."{".$dept."{".$dimset."{"."SchHead +Cnt"."{".$emp."{".$type."{".$val; write(OUTPUT2); } close(OUTPUT2); sub empnumber { my ($number) = @_; my $newnumber; if ($number < 10) {$newnumber = E00.$number} elsif ($number < 100) {$newnumber = E0.$number} else {$newnumber = E.$number} return $newnumber; }
In reply to Out of memory Error by treebeard
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |