ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Loughran <>
Subject Re: AW: Ant within Eclipse Junit OutOfMemoryException
Date Fri, 29 Jun 2007 10:43:25 GMT
Knuplesch wrote:
> Hi,
> I use an Ant Script tu run a lot of Junit Tests. I had to change the maxmemory to 1024m
to let all the Tests run.
> But sadly I used Ant directly and not Eclipse.
> But this is how I solved my memory problem in the Ant-Task:
> <junit errorproperty="dope.test.failed"
>            failureproperty="dope.test.failed"
>            maxmemory="1024m"
>            fork="yes">
>       <classpath>
>         <path refid="junit.classpath"/>
>       </classpath>
>       <formatter type="brief" usefile="false"/>
>       <formatter type="xml" usefile="true"/>
>         <batchtest todir="${}">
>             <fileset dir="${cvs.exportbox}/source" >
>                 <include name="de/icongmbh/**/*"/>
>                 <include name="functional/**/*"/>
>                 <include name="regression/**/*"/>
>             </fileset>
>         </batchtest>
>     </junit> 

that should work in eclipse too. Note that if your unit tests run out of 
memory, it means your code is leaking somehow.

Look at 
for some info on how to handle this. You can set up a forking JUnit to 
to dump the heap on a memory overflow on recent java5 and all java6 JREs:

<jvmarg value="-XX:+HeapDumpOnOutOfMemoryError" />

this creates a heap dump that jhat can bring up in a web site for you to 
browse round and debugl

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message