Sonarqube scanner taking 60+ GB of memory

Hi, I am using SonarQube Enterprise Edition Version 7.9.3 (build 33349). We are using sonarqube-gradle-plugin v. 2.6.2.

We are trying to scan a project on CI. It is part of an insurance suite (guidewire) and it is the largest of all the products (it is called PolicyCenter).

Scanning it takes 60+ GB (!). This is obviously not ideal.

How can we make the scan take a reasonable amount of memory? We tried only including things we needed and excluding expensive things to scan, like large XMLs. We also are using -XX:+CMSClassUnloadingEnabled in our _JAVA_OPTIONS.

Thanks.