I could see how the code at line 284 on
/home/fabio/ZendFramework-1.9.4/library/Zend/Mail/Protocol/Abstract.php
could attempt to take a lot of memory, if the $request was large or the
function was called multiple times.
// Save request to internal log
$this->_log .= $request . self::EOL;
You could try adding a syslog debug code before line 284 and see if the size
of the $request is the problem.
syslog(LOG_NOTICE, "{$_SERVER['REMOTE_ADDR']}: debug: Abstract.php - ".
Strlen($request));
Maybe to make it cleaner wrap a try around line 284, and then syslog the
size when an error occurs, or even dump the request string to a file and see
what it was. Though I'd start with checking the size.
Just be warned if your site is busy this could flood the syslog.
As for the similar error in a login,
http://beta.hinii.com/en/auth/loginAs a suggestion, I'd put in a limit on the number of characters they can
enter for a username/password. The form doesn't have any limit set
currently.
Not sure on the memory error, there should be a line before the "Unknown on
line 0" that might give more clues.
I've seen the "Unknown on line 0" error with db calls, file uploads and a
few other times in loops...
Terre
-----Original Message-----
From: fab2008 [mailto:
[hidden email]]
Sent: Thursday, November 05, 2009 9:48 PM
To:
[hidden email]
Subject: Re: [fw-general] Incredible memory usage on public server, normal
on dev server
jollyr0ger wrote:
>
> Hi,
> my ZF application runs perfectely with 16mb of memory (into php.ini)
> on my dev machine.
>
> The same code on the public hosting (limit to 64mb of memory) returns
> error like:
> "Fatal error: Allowed memory size of 67108864 bytes exhausted (tried
> to allocate 532655056 bytes) in Unknown on line 0"
>
> Try to allocate 500mb of memory! Can't be, it is simply loading the
> login
> page:
http://beta.hinii.com/en/auth/login>
> I've inserted memory_get_peak_usage() to the end of the request cycle
> (visible now at the end of each page) and it isn't higher than 9-10mb.
>
I have a similar problem using Zend_Mail, I found a couple of these messages
in my php logfile:
PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to
allocate 115901301 bytes) in
/home/fabio/ZendFramework-1.9.4/library/Zend/Mail/Protocol/Abstract.php on
line 284
[04-Nov-2009 14:55:41] PHP Fatal error: Allowed memory size of 134217728
bytes exhausted
Now what is strange is that enormous request of memory, how is possible to
ask system for 115MB in a single line of code? Maybe a php bug? Or more
likely a bug in php error reporting function. I can't believe that the
indicated line asks for 115MB of memory to the system.
My php version is:
# php -v
PHP 5.2.6-1+lenny3 with Suhosin-Patch 0.9.6.2 (cli) (built: Apr 26 2009
22:16:23)
Copyright (c) 1997-2008 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies
P.s. I tried to trace the error using memory_get_peak_usage() at the end of
my script. When it ends with no errors that function reports only 20-30MB of
ram used.
--
View this message in context:
http://old.nabble.com/Incredible-memory-usage-on-public-server%2C-normal-on-dev-server-tp26215767p26225656.html
Sent from the Zend Framework mailing list archive at Nabble.com.