-
Notifications
You must be signed in to change notification settings - Fork 8k
Description
Description
Hello,
First issue here, I hope everything will be fine :-)
I just found #16982 but as it's closed for a year, I thought create a new one would be more appropriate.
Also, I am not sure this is the right place to post that issue.
I just upgraded to php8.4 from php8.3 (with SF6.4 to 7.4 and doctrine 2 to doctrine 3)
Our script indexes ~32k documents from database to elastic. I also updates some data via doctrine and finding related entities. We process them by batch of 100 entities (then retrieve related ones) and clear the entity manager after each batch.
Indexing those documents uses ~257M memory with our previous version.
With php 8.4 and everything else it uses 1.4G (!!!)
I stated to use tideways in order to try to understand what's happening and found some strange behavior. Apart from my sub-optimal scripts which I upgraded and divided by 2 the time spent to index, nothing improved from memory point of view.
But I saw that \DateTimeImmutable::createFromFormat from Doctrine\DBAL\Types\DateTimeImmutableType takes 140M
I am not sure if I should report it to doctrine as I suspect some other places leaks some memory.
Also, running without tideways uses less memory (250M without, 738M with)
The fact that there is a lot of changes, the probable doctrine related issue and tideways strange behavior I am not entirely sure I should report the issue here... 😬
I don't really know how to create a stable reproducer to ensure the \DateTimeImmutable is the right thing to point out... which adds up to the pile for doubts to open that issue.
The tideways trace with php 8.4/doctrine 3/SF7.4 : https://app.tideways.io/share/trace/fec01241-c96c-4f40-9d00-da8c81d787d1 (available until 2026-01-17 09:58)
The tideways trace with php8.3/doctrine2/SF7.3 : https://app.tideways.io/share/trace/22e80010-a51b-40a1-bd7b-ec6551a4cb45 (available until 2026-01-17 09:59)
Hopefully someone could help me on this one, symfony profiler is no help regarding the volume of data.
PHP Version
8.4.15
Operating System
docker 8.4-fpm