Re: PHP (anti) crash policy?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

On 10/01/2004 11:14 AM, Olaf Van Der Spek wrote:
So Apache restarts just because it thinks that's funny?

FATAL:  erealloc():  Unable to allocate 603602944 bytes
[Sun Sep 19 16:11:16 2004] [notice] Parent: child process exited with
status 1 -- Restarting.



I was not aware that memory allocation failures could make PHP to exit its process but since it seems intentional there must be a reasoning behind that for which I am not the person that should explain. Maybe the reason has to due to the fact that when memory allocation fails, PHP allocation code can't be certain about memory integrity.


Why would memory integrity be compromised?
It's not like a buffer overflow.

Yes, but the memory allocation code does not know if the memory block that is being request was computed normally or was result of an operation with trashed values. Since it exceeds the configured limit this may be an hint of eventual process data corruption.


Anyway, I am not saying that is the reasoning that made the PHP developers decide for this behaviour. You should ask them directly in php-dev list.


Anyway, 600MB memory allocation is not normal in a typical memory application. If it is normal in your application, why don't you just raise the memory limit setting? It would avoid making PHP exit.


It's not normal in my app either.

If it is not normal, why don't you just evaluate the expected memory size that is going to be allocated before calling the PHP function that does it and handle the situation within your PHP code?


--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux