Re: PHP (anti) crash policy?

From: Date: Fri, 01 Oct 2004 14:37:59 +0000
Subject: Re: PHP (anti) crash policy?
References: 1 2 3 4 5 6 7 8 9 10 11 12 13  Groups: php.general 
Request: Send a blank email to php-general+get-198429@lists.php.net to get a copy of this message
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

« previous php.general (#198429) next »