js1 has asked for the wisdom of the Perl Monks concerning the following question:
I've written a perl script which analyzes postfix logs. However with large logs, the hashes I'm using fill up the memory quickly abends with the message 'Out of Memory'.
If I use MLDBM, I can write the hashes to disk, but I still don't have enough memory, so I wondered whether the hashes might still be held in memory as well as on disk? Here's how I've been using one of my hashes:
Does anything here look suspect? Thanks for any help.tie %maillist, 'MLDBM', "/home/u752359/maillist.db", O_CREAT|O_RDWR, 0 +640 or die $!; $maillist{$hostqid}=$mail; $msgid=${maillist{$hostqid}}->msgid; delete $maillist{$hostqid}; $maillist{$hostqid}=$nmail; foreach $hostqid (keys %maillist){
JS.
update (broquaint): tidied up formatting
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: hash on memory or disk?
by Abigail-II (Bishop) on Jan 13, 2004 at 10:37 UTC | |
|
Re: hash on memory or disk?
by DrHyde (Prior) on Jan 13, 2004 at 10:55 UTC | |
|
Re: hash on memory or disk?
by Anonymous Monk on Jan 13, 2004 at 11:22 UTC | |
|
Re: hash on memory or disk?
by js1 (Monk) on Jan 13, 2004 at 11:35 UTC | |
by js1 (Monk) on Jan 14, 2004 at 11:24 UTC | |
by Abigail-II (Bishop) on Jan 14, 2004 at 11:30 UTC | |
by js1 (Monk) on Jan 14, 2004 at 15:26 UTC |