PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Database » DB_DataObject » Bug #7702

Calling getLink /getLinks() causes memory leak

Details

Submitted2006-05-23 01:50 UTC
Fromcinod79 at gmail dot com
Assignedalan_k
StatusClosed
PackageDB_DataObject
PHP Version5.0.0
OSLinux
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");
}