Memory leak in Zend_Db_Table_Row?

This is the code I have:

<?php $start = memory_get_usage(); $table = new Zend_Db_Table('user'); for ($i = 0; $i < 5; $i++) { $row = $table->createRow(); $row->name = 'Test ' . $i; $row->save(); unset($row); echo (memory_get_usage() - $start) . "\n"; } 

Here is what I see:

 90664 93384 96056 98728 101400 

Isn't that a memory leak? When I have 500 objects to insert into the database in one script, I get a memory overflow. Can anyone help?

+4
source share
1 answer

If you get a memory error, if you insert 500 instead of 5, it really is a leak (maybe caching too). If memory usage goes up and down, that's fine: the garbage collector frees up memory again.

+1
source

Source: https://habr.com/ru/post/1311393/


All Articles