jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew van der Voort" <and...@astarte.co.nz>
Subject Memory overload
Date Sun, 27 Apr 2003 20:50:58 GMT
Sorry if this is a double post, but I haven't had any replies and can't
find my original post in the archive...

We have an ant task to perform our testing. This ant task starts jboss and
invokes junit telling it to run all our test classes. Since the test
classes all end in 'Test' (e.g. ProjectTest) and no other class does, it
just picks up all the struts test classes. 

Note that we do not have an AllTests class which builds up a suite of all
the test classes since what we've done picks them all up anyway. We tried
using the AllTests approach, but it made no difference. 

Note also that we are using StrutsTestCase for JUnit on the front end to
drive struts and that this is in container testing not mock.

The start jboss task looks like this:
  <target name="jboss.start" description="Starts JBoss on local
workstation">
    <java classname="org.jboss.Main"
classpath="${env.JAVA_HOME}/lib/tools.jar;${jboss.home}/bin/run.jar"
fork="true" dir="${jboss.home}/bin"  >
      <jvmarg value="-Dprogram.name=run.bat"/>
      <jvmarg value="-Xms256m"/>
      <jvmarg value="-Xmx384m"/>      
    </java>
  </target>

The ant task looks like this:
    <junit printsummary="false"
           haltonfailure="false"
           fork="true"
           errorProperty="test.failed"
           failureProperty="test.failed">
      <classpath refid="test.classpath.compilation"/>
      <formatter type="brief" usefile="false"/>
      <formatter type="xml"/>
      <batchtest todir="${test.data.dir}">
        <fileset dir="${build.dir}/classes" includes="**/*Test.class"/>
      </batchtest>  
    </junit>
All the tests run, but the memory used is enormous. We are regularly
hitting a situation where the tests halt with an out of memory condition
and end up having to bump the memory available to JBoss. The process
running the tests gets to about 73M at the time JBoss is started, then on
up to about 367M by the time the tests are finished. This makes for a total
machine memory footprint of over 625M which immediately drops to 153M once
the tests are finished. We have 290 tests in 37 classes.

Does anyone know why this might be? This is getting worse and worse, and we
are getting to a point where it is not scalable to continue writing test
cases.

Thanks, Andrew

Mime
View raw message