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

Coverage Report cache makes PHP report memory usage explode #1009

Closed
3 tasks done
Slamdunk opened this issue Sep 12, 2023 · 1 comment
Closed
3 tasks done

Coverage Report cache makes PHP report memory usage explode #1009

Slamdunk opened this issue Sep 12, 2023 · 1 comment
Assignees

Comments

@Slamdunk
Copy link
Contributor

Slamdunk commented Sep 12, 2023

Q A
php-code-coverage version 10.1.3
PHP version 8.2
PHPUnit version (if used) 10.3.3

Changes merged in #1005 and released 10.1.3 made Report\PHP unusable as now it always consumes too much memory.

Our coverage.php file went from 29 Mb to 737 Mb, re-processing it with phpcov or any other tool skyrockets the memory used from < 1 Gb to > 4 Gb, with no control over it and, most important, no real benefit for the purposes of re-processing many times the Report\PHP file.

#1005 is good because when you use many Report\*, the Directory is build only once and PHPUnit's report generation is faster, but Report\PHP should serialize the CodeCoverage object without the $this->cachedReport property filled.

I suggest the following improvements:

@sebastianbergmann
Copy link
Owner

All of your suggestions make sense to me, at least as short-term solutions.

Once #874 has been implemented, we should have a long-term solution.

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

Successfully merging a pull request may close this issue.

2 participants