-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Memory leak in Manager::persist() #16
Comments
I had tried to add __destruct method like this
to class https://github.com/handcraftedinthealps/ElasticsearchBundle/blob/5.x/Event/PrePersistEvent.php but it still leaks. |
I think this could be more a listener which listen to the $counter = 0;
foreach ($dataList as $data) {
++$counter;
// create and persist documents here:
if (0 === $counter % 100) {
// clear also the entityManager if used
$entityManager->clear();
// call garbage collector manually
gc_collect_cycles();
}
} Also make sure you doing imports in |
@alexander-schranz Thanks for response. Think you are right about |
When indexing a large set of documents in a cycle i see that memory usage grows every time i call manager->persist($document);
The text was updated successfully, but these errors were encountered: