Home » Database » DB_DataObject » Bug #753
mulitple inserts using lots of memory
Details
| Submitted | 2004-02-13 18:32 UTC |
|---|---|
| From | todd at groundspring dot org |
| Status | No Feedback |
| Package | DB_DataObject |
| PHP Version | 4.3.3 |
| OS | Debian |
| Roadmaps | (Not assigned) |
Comments
[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-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.