java.lang.OutOfMemoryError:Java heap space

Template for a good bug report, formatted with Markdown:

  • versions used (SonarQube, Scanner, Plugin, and any relevant extension)
  • error observed (wrap logs/code around triple quote ``` for proper formatting)
  • steps to reproduce
  • potential workaround

P.S.: use the #bug:fault sub-category if you’re hitting a specific crash/error , or the #bug:fp sub-category for rules-related behaviour

SonarQube Enterprise Edition
SonarQube Version - 8.9LTS

I have tried the following command in pipeline

set SONAR_SCANNER_OPTS=-Xmx8G

Also tried the same thing in Environmental variable. Still getting this error. Please help

Hi,

You may need to try setting a higher value.

 
:woman_shrugging:
Ann

Thanks for the quick reply. But 8GB should be enough. So there’s no approach other than this?

How big is your code base?

It is 40 MB

What else can be done?

Hi,

I’ve already given you my best answer.

 
:woman_shrugging:
Ann

Finally I got where I need to provide the command. But now I am getting this error -

##[error]The specified size exceeds the maximum representable size.

Could you please help me.(java 64 bit I am using)

Hi,

Are you sure you’re using a 64-bit JVM? Google is telling me that the theoretical max heap size for 64-bit is 16 Exabytes & in reality limited by your OS.

 
Ann

The issue got resolved with 512mb