Re: Re: [PHP] Why does this script run out of memory?

From: Date: Fri, 28 Oct 2011 19:25:20 +0000
Subject: Re: Re: [PHP] Why does this script run out of memory?
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-315511@lists.php.net to get a copy of this message
On Fri, Oct 28, 2011 at 14:05, Jim Long <php@umpquanet.com> wrote: > > the tail end of the output becomes: > >  274695    134202232 >  274696    134202672 >  274697    134203112 >  274698    134203552 >  274699    134203992 > PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 240 > bytes) in xx3.php on line 27 Each row increases memory allocation by 440 bytes. 274,700 rows would equal 120,868,000 bytes of MySQL data in the buffer. Subtracting the 240 bytes from the 440 anticipated in the 274,700th row, that means the memory footprint of your script in execution (including PHP and its extensions, Apache, the MySQL connection, et cetera) is utilizing 13,349,928 (roughly 13.4MB), which is pretty average, depending on the configuration and bloat of the builds you're using. Ways around this: increase memory allocation and risk bogging-down your machine, or use mysql_unbuffered_query(). -- </Daniel P. Brown> Network Infrastructure Manager http://www.php.net/

« previous php.general (#315511) next »