Luke Richards wrote:
> 
> Hi,
> 
> We use the Zend_Mail classes where I work and we're sending a lot of 
> emails. It was a while ago but I think we had the same problem running 
> out of memory. We tracked the problem down to the ZF SMTP transport. If 
> you are using that try overriding it with the following code. We found 
> the problem to be a log being kept on the abstract protocol class. Each 
> time the protected send method is called is attaches the request to the 
> end of the log.
> 
> class Yourlibrary_Mail_Transport_Smtp extends Zend_Mail_Transport_Smtp
> {
>     /**
>      * Send a mail using this transport
>      *
>      * @param  Zend_Mail $mail
>      * @access public
>      * @return void
>      * @throws Zend_Mail_Transport_Exception if mail is empty
>      */
>     public function send(Zend_Mail $mail)
>     {
>         $connection = $this->getConnection();
>         if ($connection instanceof Zend_Mail_Protocol_Smtp) {
>             $connection->resetLog();
>         }
>         return parent::send($mail);
>     }
> }
> 
> Hope that helps someone.
> 

It has helped me :-) It works...

When I send a lot of mails the log grows and grows without limit. The big
memory request was not for the $request var, but for reallocation of $_log
field.

Thank you very much for your hint.






-- 
View this message in context: 
http://old.nabble.com/Incredible-memory-usage-on-public-server%2C-normal-on-dev-server-tp26215767p26293955.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to