[Mimedefang] slave ran out of memory

Paul Murphy pmurphy at ionixpharma.com
Thu Mar 11 12:23:36 EST 2004


Marco,

Setting the overall memory usage to 60Mb doesn't guarantee that you can process
large ZIP files, as this is the total memory usage, rather than the maximum for
any single piece of processing.

I'm not entirely clear on when Perl incurs memory use in the object-oriented
model, but the worst case (and most probable approach) is that as soon as you
refer to an object, it is extracted and held in memory until the object is
finished with.  Since there is no way to explicitly inform Perl that you've
finished with the memory, it stays allocated but unused.

In your example, you'll need enough memory to store the MIME-encoded ZIP file
(if the uncompressed version is 7Mb, assume 5Mb for the compressed version, so
8Mb for the MIME-encoded version), plus the decoded version, plus the decoded
version written to file and read back in to File::Scan, and so on.  Just for
this bit, you're probably looking at 22Mb already, without the rest of the Perl
code and data objects for the rest of the message entities, headers, etc.

My approach is to limit the Zip file member to 50Mb, and to set the limits in
the startup file to 250Mb - if someone sends me a ZIP file to cause a DoS
attack, it is caught in the filter, whereas the 250Mb limit is to catch problems
caused by memory leaks, large messages which are still under my Sendmail limit
(such as a 19Mb message with a ZIP file which expands to 200 files totalling
200Mb), and other such issues.  My slaves run idly at about 25Mb in total
memory, with the RSS showing 1-2Mb normally, with some showing 25Mb presumably
because they've processed large files and don't free up the memory afterwards.

Best Wishes,

Paul.
__________________________________________________
Paul Murphy
Head of Informatics
Ionix Pharmaceuticals Ltd
418 Science Park, Cambridge, CB4 0PA

Tel. 01223 433741
Fax. 01223 433788

_______________________________________________________________________
DISCLAIMER:
This email and any files transmitted with it are confidential and 
intended solely for the use of the individual or entity to which they
are addressed.  If you have received this email in error please contact
the sender or the Ionix IT Helpdesk on +44 (0) 1223 433741
_______________________________________________________________________ 



More information about the MIMEDefang mailing list