Problem is timelog() in Mail::SpamAssassin. If you do not have "timelog_path <path>" set in the config, the array @{$Mail::SpamAssassin::TIMELOG->{"keeplogs"}} grows every time you scan a message with the same Mail::SpamAssassin object. That's because every call to timelog() causes the message it was passed to be stored in that array. Once the message is scanned, a flag is added to the timelog object which causes it to flush the log to disk on the next call to timelog(). It only flushes the log to disk if you have timelog_path set, however. If you do not, the log is never flushed and the array grows and grows.
spamd doesn't have this problem because the timelog log entries are stored in a forked spamd process which dies after a message is scanned. So as a workaround, add this line after $spamtest->check_message_text($msg) in the example code you posted a few days ago: @{$Mail::SpamAssassin::TIMELOG->{"keeplogs"}} = (); This should probably be added to bugzilla. * Jason Brunette ([EMAIL PROTECTED]) * Excel.Net,Inc. - http://www.excel.net/ * (920) 452-0455 - Sheboygan/Plymouth area * (888) 489-9995 - Other areas, toll-free > -----Original Message----- > From: Klaus Mueller [mailto:[EMAIL PROTECTED] > Sent: Wednesday, September 17, 2003 4:29 PM > To: [EMAIL PROTECTED] > Subject: Re: [SAtalk] Increasing memory with SA 2.55 problem > > > Hi, > > I did some more tests today. I installed the "Devel::Leak" > perl package > on the linux computer. This can be used to count number of "object" > instances. I hope the package works ok because it's an very early > version number (0.02). > > Test: > I added the data count function at five different parts of > the script in > last mail. > > 1. Before the sub method "processFile" call > 2. before the "my ($status) = > $spamtest->check_message_text($msg);" line > 3. after the "$spamtest->check_message_text($msg)" line > 4. after the "$status->finish();" line > 5. after the sub method "processFile" call > > Result: > > a) The number of "objects" between 2 and 4 differ with 262 each time. > This is a great number. But it does not seem to be the correct result. > b) The number of "objects" between 1 and 5 differ with 19 each time. > This is a problem, because I think that perl removes all data created > within a sub method call if the data is method local. But it > looks like > SA is leaving some objects alive after processing one mail. > > I tried to prove the results of the test. > > a) I commented out the "$status->finish()" line. This results in the > same result as b). The number after the sub method call > differ in 19 to > before the method call. > b) I commented out the complete SA code within the > "processFile" method. > The result between 1 and 5 is that no objects are left on heap. > > > One more test: > > I changed the code within the sub method to: > > ... > my $mail = Mail::SpamAssassin::NoMailAudit->new(data => [EMAIL PROTECTED]); > my ($status) = $spamtest->check($mail); > $status->finish(); > $mail->finish(); > ... > > The number of object created between the sub enter and sub leave is > still 19. > > I hope this test help someone to track down the problem or > help to check > that I made a mistake. > > Bye > Klaus > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Spamassassin-talk mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/spamassassin-talk > ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ Spamassassin-talk mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/spamassassin-talk