Java heap exhaustion

Java heap exhaustion is the most common memory problem that might occur during OpenText SAST scans. It is caused by allocating too little heap space to the Java virtual machine that OpenText SAST uses to scan the code. You can identify Java heap exhaustion from the following symptom.

Symptom

One or more of these messages appears in the OpenText SAST log file and in the command-line output:

There is not enough memory available to complete analysis. For details on making more memory available, please consult the user manual.
java.lang.OutOfMemoryError: Java heap space
java.lang.OutOfMemoryError: GC overhead limit exceeded

Resolution

To resolve a Java heap exhaustion problem, allocate more heap space to the OpenText SAST Java virtual machine when you start the scan. To increase the heap size, use the -Xmx command-line option when you run the OpenText SAST scan. For example, -Xmx1G makes 1 GB available. Before you use this parameter, determine the maximum allowable value for Java heap space. The maximum value depends on the available physical memory.

Heap sizes between 32 GB and 48 GB are not advised due to internal JVM implementations. Heap sizes in this range perform worse than at 32 GB. Heap sizes smaller than 32 GB are optimized by the JVM. If your scan requires more than 32 GB, then you need 64 GB or more. As a guideline, assuming no other memory intensive processes are running, do not allocate more than 2/3 of the available memory.

If the system is dedicated to running OpenText SAST, you do not need to change it. However, if the system resources are shared with other memory‑intensive processes, subtract an allowance for those other processes.

You do not need to account for other resident but not active processes (while OpenText SAST is running) that the operating system might swap to disk. Allocating more physical memory to OpenText SAST than is available in the environment might cause “thrashing,” which typically slows down the scan along with everything else on the system.