Tips for memory management, including how to increase the amount of memory that Diffblue Cover has access to.
The amount of memory utilised 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.
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.
Diffblue Cover Plugin for IntelliJ requires access to a minumum 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 and amend the Maximum Heap Size to at least 4096.
This will update the memory allocation in your
.vmoptionsfile. Please restart your IDE for these changes to take effect.
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 https://docs.oracle.com/javase/8/docs/technotes/tools/windows/java.html).
Diffblue Cover utilizes the environment variable
JVM_ARGSto specify Java options to use when running Diffblue Cover. Adding the Java option
-Xmx<max heap size>to the
JVM_ARGSenvironment 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:
PowerShell example to set maximum heap available to Diffblue Cover to 8GB:
setx JVM_ARGS "-Xmx8g"
Bash example to set maximum heap available to Diffblue Cover to 8GB: