[DDC-1783] Combination of Query::iterate() and ObjectHydrator results in continued memory growth after clearing the entity manager Created: 17/Apr/12 Updated: 27/May/12 Resolved: 27/May/12
|Project:||Doctrine 2 - ORM|
|Reporter:||Erik Bernhardson||Assignee:||Benjamin Eberlei|
ubuntu 11.04, php 5.3.6-13ubuntu3.6
Start with the doctrine sandbox. Remove address relation from user. append the following to index.php
$query = $em->getRepository('Entities\User')
echo PHP_EOL . "done" . PHP_EOL;
The result i get is
Adding my own custom hydrator which simply extends and resets the ObjectHydrator::_identifierMap (may cause bugs, i dont know) i get
This originally came up while working with an process to import an existing doctrine table of ~10M rows into elastic search. I realize going through the ORM will never be the most efficient, but there is room for more efficiency. With larger objects and larger result sets the memory growth is much more pronounced.
|Comment by Erik Bernhardson [ 17/Apr/12 ]|
code paste above didn't work out so well. Attached is a .tgz of the sandbox used above.
|Comment by Benjamin Eberlei [ 27/May/12 ]|