Reputation: 8682
I'm having a huge maven project on which the SonarQube analysis is been done, from maven everything is fine but the SonarQube background task fails because of OutOfMemoryError exception.
I have increased the heap memory for compute engine and its working for now, but is there a way to handle this in SonarQube without increasing the memory, like split the background task in to smaller tasks and combine the results?
Upvotes: 1
Views: 437
Reputation: 2936
The Compute Engine needs to load all data included in the report sent by the scanner in memory to be able to process it.
You can see in the log of the scanner the size of the report, to get a rough idea of how much data there is to process. It will of course be related to how many lines of source code is being analyzed.
[INFO] Analysis report generated in 3282ms, dir size=53 MB
[INFO] Analysis reports compressed in 5909ms, zip size=28 MB
[INFO] Analysis report uploaded in 3252ms
There is currently no way to have the scanner send fragments of the report. You can analyze for example different modules of the project separately, but this will result in different projects being created in SonarQube.
Increasing the heap size is a good solution, and using 1GB seems perfectly reasonable.
Upvotes: 2