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

Reduce memory usage of the PostAnalysisIssueVisitor #258

Merged
merged 4 commits into from
Oct 26, 2020

Conversation

thomasgl-orange
Copy link
Contributor

The collection of DefaultIssue objects hold by the PostAnalysisIssueVisitor can take a significant amount of memory in the CE process heap, when there are numerous issues (a DefaultIssue alone can weigh several 10th of kilobytes).

A small example in Eclipse MAT (and I've seen much worse):
heap

This PR mostly fixes that. The logic is unchanged: there is still a list of issues to be processed at the end. But it contains lighter objects, with only the few members which would actually be used later to decorate pullrequests. On our production instances (1.3.2 plugin / SQ 7.9 LTS), a similar patch made a major difference on the CE processes memory footprint.

I've tried to write this patch to minimize impact/changes on the code. The PostAnalysisIssueVisitor.LightIssue class exposes a subset of the DefaultIssue public interface, thus the changes are mostly limited to the actual return type of PostAnalysisIssueVisitor.ComponentIssue#getIssue().

@mc1arke
Copy link
Owner

mc1arke commented Oct 24, 2020

Thanks for the contribution. Please fix the issues highlighted by Sonarqube and ensure your new code is covered by unit tests.

@thomasgl-orange
Copy link
Contributor Author

@mc1arke, I've removed the useless import, and added unit tests for the PostAnalysisIssueVisitor.LightIssue bean definition.

@mc1arke mc1arke added the backport candidate This feature or fix should be included in another release branch label Oct 26, 2020
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 0 Code Smells

86.2% 86.2% Coverage
0.0% 0.0% Duplication

@mc1arke mc1arke merged commit 6aa89b9 into mc1arke:master Oct 26, 2020
@mc1arke
Copy link
Owner

mc1arke commented Oct 26, 2020

Merged. Thanks for the contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport candidate This feature or fix should be included in another release branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants