CruiseControl junitreport OutOfMemory errors

Filed under: CruiseControl — lars @ 12:17:52 pm

Today we had a problem where our CruiseControl build was getting OutOfMemory exceptions when running the junitreport target. This is apparently pretty common as this target often has to perform XSLT transforms on large quantities of log. I found there was a quick workaround - editing the ant shell-script located at:

cruisecontrol-bin-2.6/apache-ant-1.6.5/bin/ant

and adding the following line towards the bottom just after the existing reference to ANT_OPTS:

ANT_OPTS="$ANT_OPTS -Xms256m -Xmx768m"

This gives ANT a bit more memory to do its thing (although maybe there is a more elegant place to put this configuration?). Apparently as of CruiseControl 2.0, the actual build process is executed bu a Builder plugin, outside the CruiseControl process itself, therefore it would follow that giving more memoryt to CruiseControl itself wouldn't help in this situation.

Edit: If you do want to increase/limit the amount of memory the CruiseControl process itself uses, this can be done by editing the cruisecontrol.sh file, editing the following line:

CC_OPTS="-Xms128m -Xmx512m"

Edit2: After reducing the above, I found I had problems with cruise-control running out of memory when trying to do an XSL Transform of the log output from each build.  This would happen both when finishing a build and trying to generate the HTML Email output, but also when trying to view build reports via the web interface.  I managed to get around this by making a couple of other changes to reduce the size of the build log output:

  1. Set uselogger=true on the <ant> tag in CruiseControl's config.xml.  This reduced our 120mb log-file by about 5mb.
  2. Set the rootLogger logging level to INFO in the log4j.properties file in our main project.  This ripped about 75mb off the build log size.

Those two changes drastically reduced the size of the logfiles that are created under the cruisecontrol/logs/projectName directory.  Unfortunately it has also appeared to reduce the amount of logging written to the main cruisecontrol log: cruisecontrol/cruisecontrol.log - which can make it difficult to troubleshoot build problems without undoing this change first.

 

Comments

No Comments for this post yet...

    Leave a comment

    Allowed XHTML tags: <p, ul, ol, li, dl, dt, dd, address, blockquote, ins, del, span, bdo, br, em, strong, dfn, code, samp, kdb, var, cite, abbr, acronym, q, sub, sup, tt, i, b, big, small>


    Options:
    (Line breaks become <br />)
    (Set cookies for name, email & url)




    powered by  b2evolution