Setting Heap Size for the Jenkins Scan-Agent Plugin
The Jenkins scan-agent plugin requires a minimum of 4GB heap for scanning. The heap size may need to be adjusted based on the number of parallel scans to be executed. In addition, ensure that you are using a 64-bit Java virtual machine (JVM) to support that amount of heap space and that you run the scan agent as a Jenkins agent, which is a Java executable that usually runs on a remote machine. The procedure for setting the heap size differs depending upon the environment you are using, Windows or Linux. Follow the procedure for your environment.
On Windows
Use this procedure to set the heap size in a Windows environment.
To set the heap size in Windows, do the following:
-
Open the
jenkins.xmlconfiguration file. -
Update the
<EXECUTABLE>value to point to your 64-bit JVM:<EXECUTABLE>C:\Java\jdk1.8\jre\bin\java</EXECUTABLE> -
Update the JVM arguments (-Xmx value) to allocate a minimum heap size of 4GB:
<ARGUMENTS>-Xrs -Xmx4g -Dhudson.lifecycle=hudson.lifecycle.WindowsServiceLifecycle -jar "%BASE%\jenkins.war" --httpPort=8080 --webroot="%BASE%\war"</ARGUMENTS>noteThe heap size may have to be adjusted based on the number of parallel scans to be executed.
On Linux
Use this procedure to set the heap size in a Linux environment.
To set the heap size in Linux, do the following:
-
Open the
/etc/default/jenkins file. -
Update the JVM arguments to allocate a minimum heap size of 4GB:
JAVA_ARGS="-Xmx4096m"noteThe heap size might need to be adjusted based on the number of parallel scans to be executed.