|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-04-08 00:13 UTC] sasha at integrate dot ru
[2008-04-08 10:57 UTC] jani@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Dec 05 18:00:01 2025 UTC |
Description: ------------ Sorry for my english php with curl, dbase, dom, gd2, mbstring,pgsql, simplexml,soap,sockets It running under eAccelerator, but when I turn it off, the result is just the same. actually we use only pgsql. we get request (rather big - more than 3000 rows in result) making array of objects and then trying to convert each object into html string. converted string (each about 2 Kb length) have been pushed into array very soon memory usage growing to 64 Mb and script is crushed This problem is solved by method refact protected function _refact($arr) { $myarr=array(); while(!empty($arr)) $myarr[]=array_shift($arr); return ($myarr); } I call this function after 75, 150, 300 etc iterations, but calling this function reduce performance. Is that behaviour (I mean memory usage growing) normal? Reproduce code: --------------- Normal script (crushed) http://ver.web.integrate.ru/test1.php Cheated script (with refact method) http://ver.web.integrate.ru/test1.php Each script reports tht Init memory (Memory at the begin), how much objects it proceeds (Now showing), iteration counter (Cicling iteration), current memry usage (current memory usage) and length of string we pushed into array (string_length). Cheated script (in red hrs) show also the length of array we throw to refact method Expected result: ---------------- I guess that the memory usage won't grow while running this script because the array of objects poped every turn, and the volume of each element of this array more than the volume of elements of the result array Actual result: -------------- U can see it on url I submit