Author vstinner
Recipients rpetrov, surkamp, vstinner
Date 2008-10-24.11:27:20
SpamBayes Score 3.92004e-09
Marked as misclassified No
Message-id <>
Your example work here on:
 - Linux, i386, 2 Go of memory, Python 2.5
 - FreeBSD in Qemu, i386, 512 MB of memory, Python 2.5

> The program just eat all the CPU and with high memory usage or raise 
a MemoryError

Yes, it takes one minute or more to finish. If there is not enough 
memory, Python raises a MemoryError. The behaviour is correct: Python 
doesn't crash, it's just slow.

Your text file is ~40 MB. Python may allocate mutiple objects bigger 
than 40 MB to create the email content. The algorithm should be 
changed to work on a stream (process small chunks, eg. 4 KB) instead 
of manipule the full text in memory (+40,000 KB).

Why do you try to send 40 MB by email? Use FTP or another protocol :-p 
Or use another encoding (base64) to attach the text to the email.
Date User Action Args
2008-10-24 11:27:22vstinnersetrecipients: + vstinner, rpetrov, surkamp
2008-10-24 11:27:22vstinnersetmessageid: <>
2008-10-24 11:27:20vstinnerlinkissue4177 messages
2008-10-24 11:27:20vstinnercreate