Author Topic: memory management on the server side  (Read 5390 times)

Offline patcamen

  • Newbie
  • *
  • Posts: 1
memory management on the server side
« on: September 18, 2006, 04:23:49 PM »
hi, I've just installed the newest SVN revision (347) today and it works great, but when I first tried to send an email with about 500KB attached to it... nothing happend... after checking the error log I increased the memory_limit from 8MB to 32MB and it worked...
At that point I wanted to know how much memory it would need to send the maximum size for emails on my smtp server (10MB each email) and was surprised it used over 100MB memory on the server side... this is kind of worst I've ever seen for a php application... I played around a little with this nice memory_limit parameter and found out that about half the size of the required memory is used by "lib/Mail/mimePart.php"... which always stopped working on line 236, where it encodes the different parts of the body and attachments. Increasing the memory_limit the next break was always on line 745 of "lib/Net/SMTP.php" where it does a "preg_replace" for linefeeds through the whole email data.
I'm not a professional php programmer so I can't tell why this is such a memory hungry application, but it's definitely not ok if a program uses 80MB memory to base64 encode an attachment of 5.54MB ;)

any ideas where this giant memory consumption comes from? and how this could be fixed?

Offline RolfXXL

  • Newbie
  • *
  • Posts: 9
Re: memory management on the server side
« Reply #1 on: September 19, 2006, 09:54:39 AM »
Uhm, really? i don`t use the memory_limit, but perhabs i should!? ;-)

If that`s the truth, maybe the speed-problem, anyone spoke about in this forum, is related to
this memory problem!

Would be really intereseted in this thingy and will look after this fact on my server, too!