Memory management

Minimum memory

The amount of memory utilized by Diffblue Cover depends on the complexity of the project being analysed - complex projects will require more memory than simple projects. The minimum system requirements are 16GB RAM with 8GB allocated as heap for Java to use. By default Java allocates a quarter of the total RAM as heap, therefore this must be overridden where the amount of RAM is less than 32GB. Recommended system requirements for running Diffblue Cover alongside other memory-intensive applications include 32GB of RAM.

Out of memory due to complex projects

Not allocating enough heap to Java can result in out of memory errors - in these circumstances it is necessary to increase the memory available to Diffblue Cover above 8GB. As a rule of thumb, the memory requirements of Diffblue Cover are proportional to the memory requirements of the project being analysed.

Cover Plugin - increasing memory

Cover Plugin for IntelliJ requires access to a minimum of 4GB of memory to run effectively. If you do not have enough memory available, Diffblue Cover will automatically adjust the memory setting. You can undo this change (but please note that your IDE may be unstable without sufficient memory).

If you wish to adjust the available memory manually, please go to Help > Change Memory Settings in IntelliJ and amend the Maximum Heap Size to at least 4096.

This will update the memory allocation in your .vmoptions file. Please restart your IDE for these changes to take effect.

Cover CLI - increasing Java heap

The Java option -Xmx<max heap size> sets the maximum heap allocated to Java (more information about this option is available in the Java documentation; e.g. for Java 8

Diffblue Cover utilizes the environment variable JVM_ARGS to specify Java options to use when running Diffblue Cover. Adding the Java option -Xmx<max heap size> to the JVM_ARGS environment variable will ensure that Diffblue Cover is allocated a specific portion of system memory.

CMD example to set maximum heap available to Diffblue Cover to 8GB:

set JVM_ARGS=-Xmx8g

PowerShell example to set maximum heap available to Diffblue Cover to 8GB:

setx JVM_ARGS "-Xmx8g"

Last updated