-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[FrameworkBundle] Memory leak in 4.4.41 #46416
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
Comments
Can you create a small example application that allows to reproduce your issue? |
This leaks looks related to Doctrine. Blackfire may help you to track what leaks. |
Indeed. Are you sure, FrameworkBundle is the only package that you've updated? |
I am sure. This is the only package updated that makes the difference. I've been trying to trace the problem for more than 2 days after my last I edited my issue report with the full |
This is actually the release: symfony/framework-bundle@v4.4.40...v4.4.41 |
see https://symfony.com/doc/current/contributing/code/reproducer.html#reproducing-complex-bugs |
I went through the changes in this release and I can further confirm that the problem comes from this: https://github.com/symfony/symfony/pull/46125/files |
cc @fancyweb |
Your command generates thousands and thousands of calls to the cache (through Doctrine result and query cache) and all those calls are now traced by The profiler/data collectors will always have a memory problem in those situations where a large number of things are traced. They can't collect an enormous amount of data and at the same time not consume memory. IMHO, in your situation, the profiler should be disabled for batch processing. You could just create another env for that to test the command in "dev" mode (eg: "dev-no-profiler"). I understand it creates frustration since the change was merged on 4.4. However, I'm still in favor of keeping my patch on 4.4 since it realigns the behavior of all collector passes and IMHO, the real problem here is using the profiler/data collectors with code that overloads them while it's a known limit. If other core team members and users think it's a legitimate regression, let's revert and reapply the patch on 6.2? 😬 |
We have the same issue with the event dispatcher #32422 IMHO, we should do something in symfony, like adding a hardlimit. We already do that in the Dumper to avoid dumping to much element (cut stub) |
I would be in favor of that approach since 4.4 is nearing EOL and should be kept super-stable. |
I agree. #46442 |
I welcome your decision to revert this, as it is a nasty breaking change, albeit just in dev. As for adding it in general, I think there should be an easy way to be able to execute long-running scripts in dev without the profiler. If not, you should at least be able to turn it off based on an env variable, which I'm not sure this is possible at the moment: This doesn't seem to have any effect (memory is still being consumed until it's over):
And this gives me
|
This is not possible, because what needs to be done to reduce memory usage is to remove the Traceable decorators from the container setup, which is a build-time change, not a runtime change. |
…ctorPass (fancyweb)" (chalasr) This PR was merged into the 4.4 branch. Discussion ---------- [FrameworkBundle] Revert "bug #46125 Always add CacheCollectorPass (fancyweb)" | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | #46416 | License | MIT | Doc PR | - This reverts commit 8b6f56e, reversing changes made to fd1c94b. This change appears to be breaking for some, let's rediscuss it on 6.2. Commits ------- 36d6516 Revert "bug #46125 [FrameworkBundle] Always add CacheCollectorPass (fancyweb)"
Symfony version(s) affected
4.4.41
Description
Upgrading from 4.4.40 to 4.4.41 introduces a memory leak.
How to reproduce
Have a Command with:
Run it:
Output with
"symfony/framework-bundle": "4.4.40"
:Output with
"symfony/framework-bundle": "4.4.41"
:Possible Solution
No response
Additional Context
No response
The text was updated successfully, but these errors were encountered: