-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Console] Symfony Console memory usage increased after upgrade to Symfony 3.3 #23601
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
I guess the full Blackfire comparison profile would help, can you provide it please? (even in private eg on Slack) |
@nicolas-grekas Sure, I can share it privately, can you provide link to slack org or email address please? Thanks! |
I looked at your profile, and the issue comes from
The total (+112ms) holds almost 100% of the wall time delta. I can't say if it's legitimate or not without the app. You should compare the dumped container in 3.1 and 3.3 and see if you can suggest any fix/issue. |
@nicolas-grekas Thanks for taking time to check this. π I checked compiled containers and there is a slight increase in dumped container size (3.1M -> 3.7M). The reason for this is simple increase (3%) of number of services with the new Symfony version. However, I'm not concerned about wall time increase as much as I am about memory increase in: That's the problem I am interested in and it does seem to come from the same direction - This: also shows that memory consumption is moved from run to registering commands, which is fine, but still, commands need to be registered (unless lazy iirc) before running the app. Also, it sums up to 6.85M more in total. |
this is just the result of architectural change, don't focus on that, as the graph shows that real memory increase comes from the common node: the boot method. That's where you need to focus (click on the magnifying glass to redraw the graph around that node, etc.) But is 7Mb really an issue? |
@nicolas-grekas It is. The way we noticed this is CPU spike on the server after the upgrade is deployed. Our guess is that it comes from resque jobs, it forks to process jobs. Memory size is the biggest factor when it comes to forking taking CPU. It takes CPU to make that copy, and the amount of CPU it takes is based on the total size of the memory. |
Dunno what we can do here, for now, I'd say nothing... If the container is bigger, it takes more memory... |
@nicolas-grekas I will investigate this further. yes, this profiles are done in debug mode, but actual issue was present with debug=false. I'll post more findings if I have them, thanks for your help so far, really appreciate it! |
I profiled again Memory consumed by Results are similar with |
β¦ekas) This PR was merged into the 3.4 branch. Discussion ---------- [DI] Generate one file per service factory | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #23601 | License | MIT | Doc PR | - See #23678 for background on this proposal. Commits ------- 4037009 [DI] Generate one file per service factory
@nicolas-grekas Will do in coming days, thanks! |
Blocked by #23924. |
#23924 has been fixed. |
Good news everyone! I profiled with latest The results are awesome on the first look, great work @nicolas-grekas! Here is how All we need to do now is wait for 3.4 stable. :) |
@nicolas-grekas Is there a chance to get this optimizations in Symfony 3.3? |
@umpirsky we won't backport such big refactoring into a patch release. This is too risky (and it actually relies on new features) |
Amazing, thanks for providing such a clear proof. |
There is a noticable memory increase in console
Application
initialization after the upgrade from v3.1.10 to v3.3.5.Were there any changes in recent version that may be causing this? I saw #22900, but does not look related, I tried removing
add()
method and got similar results.The text was updated successfully, but these errors were encountered: