On Jul 1, 2009, at 12:26 , Matt Schraeder wrote:

On closer inspection, it seems that foreaching through the hits alone is enough to cause a memory usage to climb.

    foreach ($hits as $hit) {
     echo $hit->SomeData;
     echo '<br>'.memory_get_usage().'<br>';
     @ob_flush();
     @flush();
    }

It looks as if each time through the loop, the previous $hit is still in memory.

Perhaps this blog post has relevance:

  http://paul-m-jones.com/?p=262

Excerpt:

If you have two objects in circular reference, such as in a parent- child relationship, calling unset() on the parent object will not free the memory used for the parent reference in the child object. (Nor will the memory be freed when the parent object is garbage- collected.)


--

Paul M. Jones
http://paul-m-jones.com/




Reply via email to