mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
getSingleScalarResult: Enormous memory (100 MB+) and time usage if xdebug enabled #7363
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @arkhamvm on GitHub (May 4, 2024).
Bug Report
PHP 8.3.6 (FROM php:8.3.6-fpm)
Xdebug v3.3.2
Summary
Current behavior
If
NoResultExceptionis thrown inSingleScalarHydrator::hydrateAllDatait will cause xdebug stuck atAbstractHydrator::hydrateAll:In my project it is around 150 MB of memory and 5 seconds of time.
At second similar call it consumes 800 MB of memory and 30 seconds.
It is absolutly accurate that memory usage caused by
try/finallyinSingleScalarHydrator.Because this code will have no additional memory allocations:
How to reproduce
Call
getSingleScalarResultwith query that returnsNoResultExceptionwithxdebugenabled.XDebug Config:
Expected behavior
No additional memory allocations.
@beberlei commented on GitHub (May 4, 2024):
Sounds like an xdebug problem and not a Doctrine one
@arkhamvm commented on GitHub (May 4, 2024):
@beberlei maybe. But in my 10+ years of php/web development, Doctrine/ORM is the first library that causes this problem. And it's sounds easier to make changes in Doctrine, then in xdebug...
@beberlei commented on GitHub (May 4, 2024):
Doctrine is not going to change its code when something else is causing problems