Unable to generate HTML reports due to java.lang.OutOfMemoryError

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

症状

Able to instrument code correctly, run tests, and generate clover DB files and clover XML. When running HTML report generation, however, you get the following error:


BUILD FAILED
java.lang.OutOfMemoryError: Java heap space

原因

Clover requires more memory in order to create the html reports.

ソリューション

Try increasing the memory available to clover. For example up to -Xmx1024m.

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 that still gives you out of memory, increase to -Xmx2048m and set your Clover report to single-threaded mode please (set numThreads="0"). See clover-html-report.

This is normally one way to limit memory usage for large projects but at the slight cost of report generation time. If numThreads="0" works you could then try numThreads="1" (default is 2).

If that still gives you out of memory, decrease the coverage cache size (set coverageCacheSize="128m" or "64m" or even "32m"). See clover-html-report.

If that fails, or if report generation succeeds but takes a long time your project's size may be pushing Clover's current abilities to generate a report with the confines of a 32bit JVM's maximum heap size (2048m on *nix & OSX, 1546m on Windows). Please consider using a 64bit JVM with a higher heap size.

If it still fails, then please create a support case at http://support.atlassian.com and:

1) Let us know how big is your project (num files, num non-comment lines of code etc).
2) Rerun with the "-XX:+HeapDumpOnOutOfMemoryError" java parameter so that a *.hprof is created when you hit a out of memory error. (The *.hprof file should be approximately equal to the memory you allocated, i.e. for -Xmx2048m it should be around 2G big).
3) Attach the heap dump as well as the output of trying to create the report to the support case. (If the zip of the hprof file is to big to attach to the case, then let us know in the support case and we will setup a location for you to upload to).

最終更新日 2012 年 11 月 21 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.