psalm-plugin-laravel: Endless memory consumption and aborting
Describe the bug I have an issue similar to @vladyslavstartsev’s #90. On the project I currently want to refactor this plugin fails with endless memory consumption on one file every time. I limited the Psalm config with the directory containing this file only, but this didn’t help. Without the plugin Psalm runs okay but the results are unusable as they have many Laravel-specific issues.
Impacted Versions
$ composer show | grep -E 'psalm|laravel'
barryvdh/laravel-ide-helper v2.8.1 Laravel IDE Helper, generates correct PHPDocs for all F...
beyondcode/laravel-websockets 1.9.0 An easy to use WebSocket server
emadadly/laravel-uuid v1.3.2 laravel uuid a simple, automatic UUID generator for any...
fruitcake/laravel-cors v1.0.6 Adds CORS (Cross-Origin Resource Sharing) headers suppo...
laravel/framework v8.17.2 The Laravel Framework.
laravel/socialite v5.1.2 Laravel wrapper around OAuth 1 & OAuth 2 libraries.
laravel/tinker v2.5.0 Powerful REPL for the Laravel framework.
laravel/ui v2.3.0 Laravel UI utilities and presets.
laravelcollective/html v6.2.0 HTML and Form Builders for the Laravel Framework
orklah/psalm-insane-comparison v1.0.0 Detects possible insane comparison ("string" == 0) to h...
psalm/plugin-laravel v1.4.1 A Laravel plugin for Psalm
sentry/sentry-laravel 1.9.0 Laravel SDK for Sentry (https://sentry.io)
vimeo/psalm 4.3.1 A static analysis tool for finding errors in PHP applic...
Additional context I can send you the whole project archive (in private only). Specific file which aborts the analysis is a hell of a mess, but in order to fix this it would be perfect to have some handy Psalm recomendations.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 2
- Comments: 25 (6 by maintainers)
@tm1000 @maximal @borgogelli @luisgrases
Good news everyone: in release v2.5.0 we located and fixed one important memory consumption issue. Additionally, we have replaced some custom code by correct subs. There is even more potential to optimize memory consumption, but probably these steps already solved your issues guys, can you please test using latest releases (2.5+)?
If the problem persists, Ideally we need to have a small snippet that causes it - so we can add it to a testing suite and check our optimization results. Volunteers are very welcome
It also hangs for me for chained eloquent queries:
Hangs for me. If I remove one of the joins it works again. Looks like it have a max of 5 chained queries. If you have more than that it will just hang
I’m disconnecting over the holidays, I’ll take a look again next week
@lptn, seems like it works fine now (given the codebase where previous-version plugin hangs).
I think we can close the issue now.
Thank you guys!
I’m experiencing similar symptoms, memory consumption on a smallish project ramping up and eventually throwing and OutOfMemory Error. Psalm works fine without the plugin.
Interestingly I also have sentry installed like OP so potentially something to do with that?