Skip to content

Show combined memory usage in parallel mode - #2027

Merged
ondrejmirtes merged 6 commits into
phpstan:1.9.xfrom
janedbal:peak-memory-usage
Jan 3, 2023
Merged

Show combined memory usage in parallel mode#2027
ondrejmirtes merged 6 commits into
phpstan:1.9.xfrom
janedbal:peak-memory-usage

Conversation

@janedbal

@janedbal janedbal commented Nov 23, 2022

Copy link
Copy Markdown
Contributor

Closes phpstan/phpstan#4683

Looks like this:

$ php bin/phpstan clear-result-cache -q && php bin/phpstan -v
Note: Using configuration file /usr/src/myapp/phpstan.neon.
 1486/1486 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100% 56 secs/56 secs

 [OK] No errors                                                                 

Took about 1.35 GB memory

Comment thread src/Command/ErrorsConsoleStyle.php Outdated
Comment thread src/Parallel/ParallelAnalyser.php Outdated

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I dont think there is a better option. Still imo much better than before. It seems working well when comparing with system memory used.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Tested against linux ps and it gives very good results, almost equal.

janedbal added a commit to janedbal/phpstan that referenced this pull request Nov 24, 2022
Comment thread src/Parallel/ParallelAnalyser.php Outdated

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is the point of time where phpstan consumes most memory (I believe in >99% cases), so I add main thread memory at that specific time.

@ondrejmirtes
ondrejmirtes merged commit 2556918 into phpstan:1.9.x Jan 3, 2023
@ondrejmirtes

Copy link
Copy Markdown
Member

Thank you!

@ondrejmirtes

Copy link
Copy Markdown
Member

FYI these numbers were becoming irrelevant and not as precise when forking workers instead of spawning. Trying to improve it here: #6297

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.

Invalid memory consumption shown when using parallel processing and verbose mode

2 participants