How to improve memory usage of a rector run #7891
-
Hi, I run some refactorings on a big project. I do run the project with a single rector rule(ParanthesizeNestedTernary), autoloading for all needed codepaths, and also have the main directories all set as Paths(although via command line I limit to a single path of them) now the the run takes a while, thats expected(21minutes in total, with a single process), but the memory usage is continually increasing reaching 10GB. This makes me believe, there is no cleanup of loaded code happening. Is there a Setting I missed, Or any workaround? |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 2 replies
-
If you have a small reproducer I can look into it |
Beta Was this translation helpful? Give feedback.
-
This in progress PR may help here rectorphp/rector-src#3563 |
Beta Was this translation helpful? Give feedback.
-
rector-src main-branch contains now a few improvements I submitted over the last few days. people report it already made it faster and use less memory I wrote a blog post about it https://staabm.github.io/2023/05/01/diff-speeding.html the changes are not yet part of a release though |
Beta Was this translation helpful? Give feedback.
-
Avoiding node connector like parent and next/previous might help a lot. PHPStan reported great improvements :) |
Beta Was this translation helpful? Give feedback.
-
This should already resolved at PR: |
Beta Was this translation helpful? Give feedback.
This should already resolved at PR: