"how to cleanup / free database query memory in zend?" Code Answer


most probably you have the zend_db_profiler enabled.

the database profiler stores each executed query which is very useful for debugging and optimisation but leads to rather fast memory exhaustion if you execute a huge numbers of queries.

in the example you gave, disabling the profiler should do the trick:

$_db = zend_db_table::getdefaultadapter();

$start_memory = memory_get_usage();

for ($i=0; $i<1000; $i++) {
    $update_query = "update table set field='value'";

echo 'memory used: '.(memory_get_usage()-$start_memory);
By tsmith on April 27 2022

Answers related to “how to cleanup / free database query memory in zend?”

Only authorized users can answer the Search term. Please sign in first, or register a free account.