STINNER Victor <[EMAIL PROTECTED]> added the comment:

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.

----------
nosy: +haypo

_______________________________________
Python tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue4177>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to