Software Composition Analysis Group (Archived) — indra.patel (Community Member) asked a question.

Agent Based scan - How to configure Maven options to increase Java Heap space

Hi,

While I am running a desktop agent based scan, after running a while, srcclr reports "com.sourceclear.agent.commands.ScanCommand ERROR Unable to scan and generate report: Java heap space".

I think increasing heap space via Jvm options to Maven (e.g. -Xms512m -Xmx3g -XX:MaxPermSize=1024m) might do the job.

How can I make srcclr use these JVM values when running mvn during the scan which is being done manually at present on Windows 2016 server Powershell window.?

 

I see srcclr using the following options in the debug output:

 

2020-09-23/15:04:37.798 com.sourceclear.engine.component.collectors.MavenNativeCollector INFO Running Maven with: C:\MAVEN\apache-maven-3.6.3-bin\apache-maven-3.6.3\bin\mvn.cmd compile -Dcheckstyle.skip=true -e -DskipTests -DskipITs -Dmaven.test.skip=true --fail-fast --nsu -Denforcer.skip=true com.srcclr:srcclr-maven-plugin:3.1.20:scan --batch-mode -DheadlessOutputFile=C:\Users\INDRA~1.PAT\AppData\Local\Temp\graph-1593005717018069188.json

 

I have spent multiple days searching the internet, and trying the other srcclr options such as compile_first, install_first, but nothing works. Help!

 

Thanks.

Indra.


  • indra.patel (Community Member)

    I was able to overcome the issue by specifying the following before starting srcclr in the Powershell window.

    $Env:JAVA_OPTS="-Xms8g -Xmx20g".

     

    Selected as Best
  • indra.patel (Community Member)

    I was able to overcome the issue by specifying the following before starting srcclr in the Powershell window.

    $Env:JAVA_OPTS="-Xms8g -Xmx20g".

     

    Selected as Best
  • SWithey992668 (Community Member)

    This didn't fix the issue for me.. The build agents we're running on have 7GB memory so I tried limiting to 6GB, but it seems crazy that it is maxing that out! Any other options?

Topics (1)

No articles found
Loading

Ask the Community

Get answers, share a use case, discuss your favorite features, or get input from the community.