ZF-3892: memory leak in Zend_Search_Lucene->find ?


I posted about the same issue to the forums yesterday:

I ran into a strange problem using Zend Search Lucene. It seems to me that the function Zend_Search_Lucene::find has a memory leak. When running several queries in a row it might result in the program running out of memory in the worst case scenario, which is my case and lead me to notice this problem.

Here is a simple piece of code to illustrate the problem and to replicate my findings:

for($i=0;$i<100;$i++){ $index = new Zend_Search_Lucene($pathToIndex); $index->find("gabba gabba hey!"); print memory_get_usage()."\n"; }

I far as I understand memory-consumption should remain relatively constant but now it increases steadily throughout the iterations. I even tried explicitly unsetting the $index with unset($index) but it didn't help. Is it a bug in Zend Search Lucene or am I missing something? Has anybody ran into something similar yet?

I have now tested Zend Framework versions 1.5.1, 1.5.3 and 1.6.0 RC 1 as well and the same problem persists in both of them.

I am using PHP 5.2.5 in linux.


Is this maybe an issue of circular references that PHP cannot resolve in versions < 5.3?

Is this issue resolved ? Actually I am facing same issue, for every find operation 100MB space is allocating but the same memory is not de-allocating after request processing...

Please let me know the solution if any body knows..

Thanks in advance.