ZF-5170: Zend_Db_Adapter_Pdo_Mssql memory leak?
I have a problem with Zend_Db when using a mssql-database. I'm working several month with Zend Framework now, and was writing a kind of "windows service" in php (with php cli as service or scheduled task). This script runs very long (many days/weeks) in a loop. But I experienced memory problems with Zend_Db.
With each SQL-Query the Zend_Db object seems to grow a bit, depending on the select-result-size!!! Even with only one result row, the script-memory-usage grows. If I do INSERTs or UPDATES, all works fine, but when doing SELECTs, the script-memory-usage grows and grows. And my script runs many days and has 100.000 selects a day, which results in >100MB memory usage growth per day. So I have to restart the script every day ;-(
Zend_Db seems to cache that results or so, I don't know. Zend_Db_Profiler is disabled of cause.
I did a few tests, tested PEAR-MDB2 and also Zend_Db Pdo_Sqlite-Adapter . With these two methods I didn't experience a memory growth.
I will attach my test files, so you can check it on your own. You will need PEAR MDB2 installed to run it (or you disable that part). I will also attach my results (results.txt), where you can see, that sqlite and mdb2 don't grow, but mssql does!
I cannot use Zend_Db with that bug. Please fix it soon!