Home » Database » DB_DataObject » Bug #7702
Calling getLink /getLinks() causes memory leak
Details
| Submitted | 2006-05-23 01:50 UTC |
|---|---|
| From | cinod79 at gmail dot com |
| Assigned | alan_k |
| Status | Closed |
| Package | DB_DataObject |
| PHP Version | 5.0.0 |
| OS | Linux |
| Roadmaps | (Not assigned) |
Comments
[2006-05-23 01:50 UTC] cinod79 at gmail dot com
Description:
------------
Db_dataobject does not free linked objects to it self. Even when calling get free() on the main object, the memory usage piles up.
getLinks() - memory usage will never be free and there is no way to explicitly free them
getLink() - memory usage is never free but there is a workaround it. calling
$xx = $object->getLink("columnname");
$xx->free();
will cure this
Test script:
---------------
Please look at the code below, you will notice a increment of memory usage even if free() is called.
for($i=0;$i<10;$i++){
$txnRecordObj = DB_DataObject :: factory('txnrecord');
$txnRecordObj->find();
$group = DB_DataObject :: factory('institution');
while ($txnRecordObj->fetch()) {
$txnRecordObj->getLinks();
}
$txnRecordObj->free();
$finalMem = memory_get_usage();
echo("\nmemory usage : $finalMem");
}