![]() |
|
Welcome to the Monastery | |
PerlMonks |
Re^2: Reducing memory usage while matching log entriesby matt.tovey (Beadle) |
on Feb 01, 2006 at 15:49 UTC ( #527078=note: print w/replies, xml ) | Need Help?? |
And you're doing something really weird with @lines; if you get to line 100,000 it's going to allocate a 100,000 element array. Considering it's probably sparse you should use a hash for that as well.
Yes, that's the file being held in memory. :( I just tried putting that into a hash (also using 'delete' now - thanks!). It runs only slightly slower, and consumes quite a bit less memory, so success there!
In Section
Seekers of Perl Wisdom
|
|