Fix memory leak in AbstractHydrator - Follow up #6630

Closed
opened 2026-01-22 15:36:04 +01:00 by admin · 0 comments
Owner

Originally created by @olsavmic on GitHub (Feb 17, 2021).

I have encountered an issue with a memory leak in SingleScalarHydrator.

AbstractHydrator::hydrateAll() method does not take into account the possibility of an exception being thrown so when SingleScalarHydrator::hydrateAllData throws NoResultException/NonUniqueResultException, the event listener for onClear event is not removed and the hydrator is stuck in the memory.

It's been solved here once but not merged due to missing test cases.

Original issue: Fix memory leak in AbstractHydrator

I'll try to provide a fix and appropriate test case for this issue so it can be finally merged.

Originally created by @olsavmic on GitHub (Feb 17, 2021). I have encountered an issue with a memory leak in SingleScalarHydrator. `AbstractHydrator::hydrateAll()` method does not take into account the possibility of an exception being thrown so when `SingleScalarHydrator::hydrateAllData` throws `NoResultException`/`NonUniqueResultException`, the event listener for `onClear event` is not removed and the hydrator is stuck in the memory. It's been solved here once but not merged due to missing test cases. Original issue: [Fix memory leak in AbstractHydrator](https://github.com/doctrine/orm/pull/7315) I'll try to provide a fix and appropriate test case for this issue so it can be finally merged.
admin closed this issue 2026-01-22 15:36:04 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#6630