I am trying to reduce my memory usage on a large loop script so I made this little test. Using Doctrine I run this code:
$new_user_entry = getById($new_user_entries[0]['id']);
unset($new_user_entry);
$new_user_entry = getById($new_user_entries[1]['id']);
unset($new_user_entry);
function getById($holding_id)
{
return Doctrine_Core::getTable('UserHoldingTable')->findOneById($holding_id);
}
But it leaves about another 50 KB in the memory for each time I do the getById and unset and I don't know why or how to change it. I have a loop that goes through thousands of these plus a couple other functions and this is creating an issue.