HTML report generation takes a very long time

Still need help?

The Atlassian Community is here for you.

Ask the community

Symptoms

Able to instrument code correctly, run tests, and generate clover DB files and clover XML. When running HTML report generation, however, the report generation takes a very long time.

Causes

  • Clover HTML report generation is, by default, optimised to minimise memory usage. For some projects these optimisations may slow down report generation.
  • To generate reports efficiently sometimes Clover requires a slightly larger memory heap than is currently allowed and this may cause excessive memory swapping.

Resolution

First increase the memory available to Clover to the maximum allowed for your JVM. For example up to -Xmx2048m on *nix 32 bit JVMs, -Xmx1546m on Windows 32 bit JVMs. Consider using a 64 bit JVM for reporting on large projects (> 500k LOC) with many test methods (> 1000) as Clover may need more heap than a 32bit JVM can provide.

To increase for Ant, you need to set it in your ANT_OPTS environment variable. E.g. export ANT_OPTS="-Xmx1024m -Xms256m"

Similarly for Maven, you need to set it in your MAVEN_OPTS environment variable. E.g. export MAVEN_OPTS="-Xmx1024m -Xms256m"

If this does not improve report times, then disable calculation of unique test coverage (the calculation of the code coverage a test methods provides that is provided by no other test method) by setting showUniqueCoverage to "false". See clover-html-report

If this does not improve report times, then gradually increase numThreads (the number of additional Clover report threads) to see if this improves the situation. The default is 2 so start with 3 and increase from there if performance times improve. See clover-html-report

If this does not speed up report generation and if your project has a large number of tests and a high lines-of-code count then reset numThreads to its default value of 2 and try disabling the per-test coverage cache by setting coverageCacheSize="nocache". See clover-html-report

If this results in an out of memory exception during report generation then reduce numThreads (the number of additional Clover report threads used) to 1 or, failing that, to 0.

If it still fails, then please create a support case at http://support.atlassian.com and let us know how big is your project (number of files, number of non-comment lines of code, number of test methods etc).

Last modified on Jun 6, 2010

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.