SonarQube 10.4 gradleplugin scan failing with jave heap space issue

We are using sonarqube verion 10.4(enterprise sonar) deployed via zip . We facing an issue with the analysis of one our projects . While it is absolute working fine on our another instance which is 10.0 (developer edition).
On the 10.4 version , the project analysis never done and it says java heap space is out of space.
We tried with giving 22g as well but stilll it runs for forme than 8 hours and then fails with the error

  • Out of memory: Java heap space (This problem is reported because OutOfMemoryError has been found in the build log text); gradle

We are using java 17 in both the cases for project .

log.txt (63.7 KB)

Additional inofrmation:

fro increasing ram we are using :
Sonar Gradel plugin :

Hi Team,
Any help will be appreciated.