Depending on the user’s project, test generation may require a significant amount of memory. Diffblue recommends running
jcover on a system with either 8GB or 16GB of RAM, as the maximum amount of memory
jcover uses is limited to a quarter of the available RAM by default.
However, if you are getting out of memory errors, you can increase the amount of memory
jcover has access to by specifying the
JVM_ARGS environment variable. All the default Java options documented at: https://docs.oracle.com/javase/8/docs/technotes/tools/windows/java.html can be added to this variable. For example, if you run on a machine with 4GB of RAM then the default maximum Java heap size would be 1GB. The examples below show how to increase the maximum Java heap size from 1GB to 2GB in that case.
set JVM_ARGS=-Xmx2g jcover create
setx JVM_ARGS"-Xmx2g" dcover.bat create
Please note that allowing the JVM to use too much memory can severely impact performance. For this reason, we suggest that the maximum heap size available to the JVM is set to at least 5GB less than the total RAM or, for systems with less memory, 1GB less.
export JVM_ARGS=-Xmx2g jcover create