Skip to content

[DoctrineBridge][Form] Fix EntityType memory leak #44497

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

Closed
wants to merge 1 commit into from

Conversation

kbond
Copy link
Member

@kbond kbond commented Dec 7, 2021

Q A
Branch? 5.4
Bug fix? yes
New feature? no
Deprecations? no
Tickets Fix #40965
License MIT
Doc PR n/a

Symfony 5.1 (#30994) introduced a memory leak (at least for functional tests) when using the EntityType. See #40965 (comment) for more details.

@@ -97,6 +98,15 @@ public function boot()
}
}

public function shutdown()
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fixes the issue but I don't expect this is the proper solution. I'd like some input on where this fix should be made.

@kbond kbond changed the base branch from 5.3 to 5.4 February 15, 2022 18:24
@kbond kbond modified the milestones: 5.3, 5.4 Feb 15, 2022
parent::shutdown();

if (class_exists(AbstractStaticOption::class)) {
AbstractStaticOption::reset();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would adding this call to DoctrineType::reset() fix the leak for you?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, that didn't work.

@nicolas-grekas
Copy link
Member

Closing as this is certainly not the appropriate patch, if any is needed at all. See linked issue for next steps.

@kbond kbond deleted the entity-type-memory-leak branch February 18, 2022 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants