-
Notifications
You must be signed in to change notification settings - Fork 461
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
Show combined memory usage in parallel mode #2027
Conversation
@@ -221,6 +227,7 @@ public function analyse( | |||
$internalErrorsCount === 0 ? $dependencies : null, | |||
$exportedNodes, | |||
$reachedInternalErrorsCountLimit, | |||
(int) array_sum($peakMemoryUsages), // not 100% correct as the peak usages of workers might not have met |
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.
I dont think there is a better option. Still imo much better than before. It seems working well when comparing with system memory used.
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.
Tested against linux ps
and it gives very good results, almost equal.
d7ea71b
to
a3160a6
Compare
}, $handleError, function ($exitCode, string $output) use (&$internalErrors, &$internalErrorsCount, $processIdentifier): void { | ||
}, $handleError, function ($exitCode, string $output) use (&$someChildEnded, &$peakMemoryUsages, &$internalErrors, &$internalErrorsCount, $processIdentifier): void { | ||
if ($someChildEnded === false) { | ||
$peakMemoryUsages['main'] = memory_get_usage(true); |
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.
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.
6220763
to
555ceb1
Compare
38ebd85
to
f706989
Compare
f706989
to
21a14dd
Compare
Thank you! |
Closes phpstan/phpstan#4683
Looks like this: