in reply to Reducing memory usage while matching log entries
I don't understand why you are using the @lines array at all, and without that your memory requirements go way down. The logic would be something like:
Your existing code is close to that: remove the references to @lines; replace the definition of $count with:
change the action for unlocking to:my $count = $.; # input line number
and replace the final foreach (@lines) {print} with:delete $locks{$address};
for (sort keys %locks) { Log 0, "ERROR: address $_ locked at line $locks{$_} but never unlock +ed."; }
Hope this helps,
Hugo
|
|---|