My tests are failing due to an out of memory error (see below) when being executed within the TeamCity Agent Ant Build Runner but not when run from the command line.
I'm using TeamCity Professional Version 3.1.1 (build 6828)
The agent running the tests is the default agent installed on the same box as TeamCity server. There are 2 GB installed on the box and aprox one GB available in memory before running any tests.
The memory error is as follows:
java.lang.OutOfMemoryError: PermGen space
This error occurs just at the end of running the test target when executed by the TeamCity Agent Ant Build runner.
The test target builds out the domain and test classes and then executes two junit test batches each containing 110 and 12 tests respectively. The JVM is not forked in either case.
I've monitored the memory utilized while the tests are running and the memory utilization constantly grows from 1.02GB to 1.6 GB.
Note that if I run the same ant test target from the agent build work directory just using Ant then the build is successful and memory utilization is at most 900MB. It appears that the Ant Build runner is not releasing any resources.