title: Out of memory error in php
body: <p>I am on php 5.2.5 and executing a script from command line. In this script I am manipulating the data fetched from db. To fetch data from db I am using Zend Adapter.
  I notice an <strong>increase in memory(262144 bytes)</strong> after invoking 
   <strong>"fetchAll($sql,$data,Zend_Db::FETCH_ASSOC)"</strong>  </p>
  
  <p>Hence finally leading to out of memory. 
  To test I just executed "fetchAll" without even storing the data returned by it in any variable. But still I see an increase in memory which is not reclaimed. </p>
  
  <ul>
  <li>Is there any memory leak issue with Zend FetchAll method?</li>
  <li>Why does the memory increase by 262144 or in multiples of 262144?</li>
  <li>The memory increase happens randomly and not in all fetchAll calls, why so?</li>
  </ul>
  
  <p>I have tried using memory_get_usage() to determine the cause of memory leak, but since the code is huge it is taking a lot of time, is there any  way I can get the details of all the objects in memory so that I can debug the issue better? </p>
  
  <p>The sql is:-</p>
  
  <pre><code>select b.Id as Id,b.Lang 
  from groups g 
  left join table1 b on b.Group_Id = g.Id 
  left join table2 bs on bs.Id = b.Id 
  where g.Id = ? and b.Lang = ?
  </code></pre>