in reply to Archive-Zip memory problems

Wanted to thank everyone for responding, first of all. I've made a few changes to the test code based on the suggestions and it looks like the problems have *mostly* cleared. What I'm seeing now is a bottleneck more than anything. One Zip is processed (each Zip contains one server log file), the script slows to a crawl for about 1-3 minutes when the one Zip is done and the next begins, and then it continues whizzing through the text file (I'm roughly gauging the speed by having a line counter updating). I'm still a little puzzled by the bottleneck. My best guess is some sort of buffer size issue. Thanks again!
use Archive::Zip; use Archive::Zip::MemberRead; ...a few other variables set up here... @files = qw(ex041201.zip ex041202.zip ex041203.zip ex041204.zip); foreach $file (@files) { open(LOG, ">>$log_terms") || die "Cannot open $log_terms. $!"; $zip = new Archive::Zip("$source/$file"); $text = new Archive::Zip::MemberRead($zip, "WebTrends.log"); while (defined($line = $text->getline())) { @splitline = split / /, $line; ...do some processing... undef(@splitline); } } undef($text); undef($zip); close(LOG); } print "\a"; }

Replies are listed 'Best First'.
Re^2: Archive-Zip memory problems
by redhotpenguin (Deacon) on Dec 20, 2004 at 20:51 UTC
    If you want to find the bottleneck then profile the program:
    perl -d:DProf myscript.pl dprofpp