Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.11.5

Bug #753 mulitple inserts using lots of memory
Submitted: 2004-02-13 18:32 UTC
From: todd at groundspring dot org Assigned:
Status: No Feedback Package: DB_DataObject
PHP Version: 4.3.3 OS: Debian
Roadmaps: (Not assigned)    

 [2004-02-13 18:32 UTC] todd at groundspring dot org
Description: ------------ I created a loop to insert 10000 rows by reusing the same DataObject instance. However, it's exceeding the 8MB memory limit on our server around the 4300th insert. Perhaps it's holding on to some sort of cache/transaction history. Also using Apache 1.3.29 Reproduce code: --------------- DB_DataObject::DebugLevel(1); $org = new DataObject_ENOrganization(); $orgCnt = $org->count(); echo( "$orgCnt orgs <br>"); for($i = 0; $i < 10000; $i++) { //reset the primary key $org->setId(null); //a unique key, but not the primary $org->setAccountId($orgCnt + $i); $rslt = $org->insert(); } Expected result: ---------------- 10000 new rows in the "organization" table of a MySQL db. Actual result: -------------- Out of memory error (upper limit set to 8MB) around the 4300th insert.


 [2004-02-14 06:24 UTC] alan_k
try turning off overload : eg. define('DB_DATAOBJECT_NO_OVERLOAD',true); require_once 'DB/DataObject.php'; Overload leaks memory rather badly...
 [2004-02-14 07:23 UTC] alan_k
the CVS version still leaks some memory with overload on - but alot less now. I got < 1Mb over the 10000 queries. (as originaly I had about 80Mb leaking)
 [2004-02-17 18:38 UTC] todd at groundspring dot org
I got the same result with overload turned off. I'd like to use overloading as well, so I will try moving to Apache 2 and see if that helps.
 [2004-02-18 01:43 UTC] alan_k
"I got the same result with overload turned off." this is strange - can you have a look at the test script in CVS The idea there is to cat /proc/{processid}/status | grep VmData Also try running the test under command line php..
 [2004-06-28 09:48 UTC] alan_k
No feedback was provided. The bug is being suspended because we assume that you are no longer experiencing the problem. If this is not the case and you are able to provide the information that was requested earlier, please do so and change the status of the bug back to "Open". Thank you.