Home » Database » DB_DataObject » Bug #9525
$o->free() not working when $o->count()
Details
| Submitted | 2006-12-01 20:43 UTC |
|---|---|
| From | jensg at subsist dot de |
| Status | Closed |
| Package | DB_DataObject |
| PHP Version | 4.3.10 |
| OS | Debian sarge |
| Roadmaps | (Not assigned) |
Comments
[2006-12-01 20:43 UTC] jensg at subsist dot de
Description:
------------
I did many count queries on a large table. The calling of free() seems to do nothing when used with count() like in my test. Outputing your global $_DB_DATAOBJECT at the end shows a big amount of data within $_DB_DATAOBJECT[RESULTS] which should be not there after calling free(). The amount of memory which is used is increased at a very high rate. (memory_get_usage() with 10000 iterations from 3 to 14 MB, also top is reporting a Virt size rise from around 20MB to 120MB!!! which I find also very interesting)
If I change $tobj->count() to $tobj->find() free() works and the memory is almost constant.
Test script:
---------------
$tobj = &DB_DataObject::factory('Table');
//ids array holds many ID's
foreach ($ids as $v) {
$tobj->a_id = $v;
$num = $tobj->count();
$xnews->free();
}
Expected result:
----------------
constant memory consumation
[2007-02-05 11:26 UTC] jensg at subsist dot de
its working for me