Skip to content
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

Large memory consumtion #4401

Closed
fezfez opened this issue Jan 20, 2021 · 7 comments
Closed

Large memory consumtion #4401

fezfez opened this issue Jan 20, 2021 · 7 comments

Comments

@fezfez
Copy link

fezfez commented Jan 20, 2021

Bug report

When a run phpstan i got a large memory consumption (2G~) on code base with 2500 class
After running phpstan with --debug -vvv option i found a class that consume 338MB (!).

Code snippet that reproduces the problem

i made a little repository with a complete reproduction case https://github.com/fezfez/phpstan-memory

Expected output

I think the expected output must be the same usage of memory, because none of the class are used.

@mergeable
Copy link

mergeable bot commented Jan 20, 2021

This bug report is missing a link to reproduction on phpstan.org.

It will most likely be closed after manual review.

@ondrejmirtes
Copy link
Member

Thank you, this is very interesting!

@ondrejmirtes
Copy link
Member

Yeah, it wasn't that hard :) phpstan/phpstan-src@e4b6ffd

Results:

~/Development/phpstan/bin/phpstan analyse --debug -vvv src/MemoryConsumption.php
Note: Using configuration file /Users/ondrej/Downloads/phpstan-memory/phpstan.neon.
Result cache not used because of debug mode.
/Users/ondrej/Downloads/phpstan-memory/src/MemoryConsumption.php
--- consumed 2 MB, total 46 MB
Result cache was not saved because only files were passed as analysed paths.


 [OK] No errors


Used memory: 46 MB

Before:

./vendor/bin/phpstan analyse --debug -vvv src/MemoryConsumption.php
Note: Using configuration file /Users/ondrej/Downloads/phpstan-memory/phpstan.neon.
Result cache not used because of debug mode.
/Users/ondrej/Downloads/phpstan-memory/src/MemoryConsumption.php
--- consumed 334 MB, total 370 MB
Result cache was not saved because only files were passed as analysed paths.


 [OK] No errors


Used memory: 370 MB

@fezfez
Copy link
Author

fezfez commented Jan 20, 2021

Thanks, blazing fast ! :)

After re testing on my whole projects

before : total 1.51 GB
after : total 1.39 GB

@fezfez
Copy link
Author

fezfez commented Jan 20, 2021

Can i expects a release in a short while?

@ondrejmirtes
Copy link
Member

There was a release on Monday 2 days ago, expect one after this upcoming weekend :)

This was referenced Jan 20, 2021
@github-actions
Copy link

github-actions bot commented May 1, 2021

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants