Home » Mail » Mail_Queue » Bug #794
Out of memory
Details
| Submitted | 2004-02-19 07:17 UTC |
|---|---|
| From | thoa0025 at mail dot usyd dot edu dot au |
| Assigned | quipo |
| Status | Closed |
| Package | Mail_Queue |
| PHP Version | 4.3.3 |
| OS | linux |
| Roadmaps | (Not assigned) |
Comments
[2004-02-19 07:17 UTC] thoa0025 at mail dot usyd dot edu dot au
Description:
------------
Mail_Queue runs out of memory when i send HTML based emails as it stores the headers and bodies which are large strings in memory.
This occurs depending on the email but usually when i send 25-50 emails which are all HTML based.
My php installation allows only 24mb of memory in it's execution and the array holding all the Mail_Queue_Body gets larger than it can be.
To fix this I modified the system NOT to store the header and body strings in memory, and retreive and return them from the database, when the getHeaders() or getBody() method is called (which in my application is only once in it's lifetime).
[2004-02-21 11:06 UTC] thomas-pear at mysnip dot de
So you retrieve each message alone on sending it?
are these html messages that large?
maybe its usefull to have a switch for that behaviour.
[2004-02-21 13:06 UTC] chief at php dot net
It should be possibility to fetch() each mail separately instead of reading all to the queue at once. Thanx for the info I will try do this without breaking BC.
[2004-02-29 23:43 UTC] thoa0025 at mail dot usyd dot edu dot au
No, only the meta information for the mail_queue record is retreived (everything which is currently retreived minus the body and the headers).
When the header or the body is needed it is retreived out of the database.
My hack, has really coupled the database into the object which is probably what you do not want.
The emails are not huge. A html email template is used with about 500 characters of text. So storing 25-50 emails in memory kills the application.