Memory leak in fetchAll()

For programming and general questions on Zend Framework

Memory leak in fetchAll()

Postby nidhik on Wed Nov 07, 2012 4:05 pm

Hi

I am on zend version 1.11.11 and executing a cron job in php whic is facing a memory leak issue with fetchall() method in Zend_Db_Adapter_Abstract.
I am using Zend_Db_Adapter_Mysqli to fetch data from db. On executing fetchall() I see an increase in memory which is not reclaimed. The method sample is :

public function getData($id) {

$sql = 'select ------ where Id = ?';

// create the bind array
$data = array( $id);
$conn = new Zend_Db_Adapter_Mysqli();
$results = $conn->fetchAll($sql, $data, Zend_Db::FETCH_ASSOC);
$data=somefunction($results);
return $data;
}

On looking further into fetchall() , I found that the execute method was increasing the memory. It seems obvious since data will be fetched from db but the increase in memory is not reclaimed.I am making the fetch call with same sql in a loop and after every fetch the memory does not increase , it increases randomly in some fetch calls and keeps pilling up.

Questions:
Why is the memory not getting reclaimed after fetch call ?
Is there a way to free up this memory by fetchcall ?
Why is the memory not increasing after every fetch call ?

Thanks
nidhik
 
Posts: 2
Joined: Wed Nov 07, 2012 3:41 pm

Re: Memory leak in fetchAll()

Postby nidhik on Wed Nov 07, 2012 4:12 pm

Adding to the above post : The profiler is also disabled.
nidhik
 
Posts: 2
Joined: Wed Nov 07, 2012 3:41 pm


Return to Zend Framework

Who is online

Users browsing this forum: Google [Bot] and 1 guest