Re: PHP (anti) crash policy?

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

 



Hello,

On 10/01/2004 11:34 AM, Olaf Van Der Spek wrote:
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?


Because I've no idea how gzinflate decides how much memory to allocate.

Use worse case estimates. AFAIK, that algorithm can only compress upto 5:1 . If you are taking data from a file, read the file size and multiply by 5 . If the resulting case exceeds the reasonable memory limit, you should not bother to even try opening that way.


--

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