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

[Documentation:Developer] Update PHPStan Baseline Command #553

Merged
merged 4 commits into from
Oct 2, 2023

Conversation

NiaHeermance
Copy link
Contributor

@NiaHeermance NiaHeermance commented Sep 27, 2023

The PHP baseline command now suggests providing phpstan additional memory.

image

@MasterOdin
Copy link
Member

Does phpstan actually need 8GB of memory to function, or is this just setting the value to something ridiculously high just in case?

Also, I would consider using the --memory-limit CLI flag to phpstan itself to set the memory, vs passing it to PHP, so as to make this change a bit more portable, such as relying on composer run-scripts to run it.

@williamjallen
Copy link
Member

@MasterOdin On my system, PHPStan uses less than 2GB of memory. (use the -v flag to see memory usage)

I believe that Nia originally got the 8GB from me -- I arbitrarily chose 8GB as a relatively large value that we should never get to. I agree that we should recommend the --memory-limit flag.

@NiaHeermance
Copy link
Contributor Author

Tested with --memory-limit 2G and it works. Updated the PR. Better now?

@bmcutler bmcutler merged commit 7e145b4 into main Oct 2, 2023
@bmcutler bmcutler deleted the add-memory-php-advice branch October 2, 2023 00:26
Copy link
Member

@ziesski ziesski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For some reason I always thought --memory-limit needed equal sign i.e. --memory-limit=4G. I just checked the website, and realized I was wrong.

@williamjallen
Copy link
Member

@ziesski If you define the memory limit via PHP's -d flag, you use -d memory-limit=4G. That might be what you're remembering.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants