-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Regression related to Improve lazy ghost performance by avoiding self-referencing closure #11455
Comments
@nicolas-grekas Can you please consider this issue as you created the commit 9d1a497 If you need more information or to test something I'm available. |
A small repo with instructions to reproduce would help a lot 🙏 |
I tried to create a small / simple reproducer, but could notice the issue is also related to the number of elements I have in the ResourceFile table in database. If I reduce the number of elements I don't get the MemoryLimitError. I also detected that I got the error if I load the parent entity. For example in the following sample The formDefinition entity contains a logo (ResourceFile id 24163). If I comment the first line I don't have any Memory issue, but if I uncomment it the memory issue happen. $formDefinition = $entityManager->getRepository(FormDefinition::class)->find(3829);
$resourceFile = $entityManager->getRepository(ResourceFile::class)->find(24163);
$copy = clone $resourceFile; Here is the debug: And at some point a query is done without restricting on ID: If in if ($this->creationDate) {
$this->creationDate = null;
} The code is not very easy to read so I can't provide more information for now. |
@nicolas-grekas Here is a reproducer:
Result Downgrade to doctrine/orm:2.19.2 and rerun phpunit:
As you can see in the first result the query doesn't contain the where restriction. That's why that was leading to an OutOfMemoryError in my case as I have a lot of entities in my table. Can you please have a look now? |
Thanks for the reproducer. I already spotted a bug but not the one you reported :) Stay tuned. |
Nice 👍 thanks |
This should be fixed by #11475 |
Bug Report
Summary
From the following commit of doctrine/orm 2.19.3 I got a OutOfMemoryError when trying to clone an entity that contains a blob value: 9d1a497
If I revert this change I have no issue and the Memory is low: less than 4Mo but when I apply the change, even if I allocate 2G of memory I got the OutOfMemoryError .
Current behavior
Infinite memory rise which leads to an OutOfMemoryError.
How to reproduce
As soon as I call
getCopy();
I got an OutOfMemoryError:Please note that I have no issue if I call
$formDefinition->getLogo()->getContent()
to load the resource before calling$formDefinition->getLogo()->getCopy()
:Expected behavior
Just clone the entity.
The text was updated successfully, but these errors were encountered: