Cruise Control and/or ANT out of memory error

When setting up a flex app auto build task, I started getting the following error consistently.

Error: null
java.lang.OutOfMemoryError

THE FIX, for me was: Add to ant.bat, antRun.bat

set ANT_OPTS=-Xmx512m
set ANT_OPTS=-Xms64m -Xmx512m

First I tried changing the Cruise Control memory settings in cruisecontrol.bat (CC_OPTS=-Xms256m -Xmx768m -Xmn256m).But I think it was less likely for the cruise control process to have memory issues than the ant tasks I was using (as Jeffrey pointed out before I could clean this up a bit – thanks).

I was noticing that the java.exe service that was handling the process would go up to 100 MB of memory usage, and then stop there, and then tank. The following article points out how to change the ant task memory settings. Because of the way cruise control was calling the ant task, it made it necessary to modify the the .bat files in the ant folder (You can use the <ant><jvmarg>… tag, as per the links below, in some cases). Once the .bat’s had the ANT_OPTS memory settings in place, the process would use more memory and build the flex app. Nice.

Check out the following articles:

http://confluence.public.thoughtworks.org/display/CC/OutOfMemoryError

http://cruisecontrol.sourceforge.net/main/configxml.html#ant