Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[Routing] fix memoryleak when loading compiled routes#34920
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
stof commentedDec 10, 2019
The static cache should be keyed by cache file. Otherwise, this will break things in case you have multiple router instances in the project with different config (I already saw such cases, for instance when usinghttps://github.com/hautelook/TemplatedUriRouter in parallel of the normal router) |
stof commentedDec 10, 2019
OK, I'm tired. That's already the case. |
| privatestaticfunctiongetCompiledRoutes(string$path):array | ||
| { | ||
| if ([] ===self::$cache &&\function_exists('opcache_invalidate') &&filter_var(ini_get('opcache.enable'),FILTER_VALIDATE_BOOLEAN) && (!\in_array(\PHP_SAPI, ['cli','phpdbg'],true) ||filter_var(ini_get('opcache.enable_cli'),FILTER_VALIDATE_BOOLEAN))) { | ||
| self::$cache =null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
What is the reason for disabling this memory cache when using OPCache ? Does OPCache fix the memory leak ?
nicolas-grekasDec 10, 2019 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
yes, opcache fixes the leak: the required data are plain arrays, which don't leak.
fabpot commentedDec 11, 2019
Thank you@nicolas-grekas. |
…olas-grekas)This PR was merged into the 4.3 branch.Discussion----------[Routing] fix memoryleak when loading compiled routes| Q | A| ------------- | ---| Branch? | 4.3| Bug fix? | yes| New feature? | no| Deprecations? | no| Tickets | -| License | MIT| Doc PR | -Same as#34918 for Routing. That's the last significant memory hog I've identified.Commits-------85371a1 [Routing] fix memoryleak when loading compiled routes
Same as#34918 for Routing. That's the last significant memory hog I've identified.