1 Reply Latest reply on Apr 23, 2003 8:07 PM by Adrian Brock

    JUnit/Cactus memory problem

    Andrew Newbie

      Windows 2000
      JBoss 3.0.4
      Cactus 13-1.4.1
      StrutsTestCase 1.9.6

      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:

      The test task looks like this:

      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 at the moment and our plan is (was) to triple this.

      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 which are, of course, a good thing to have.

      Thanks, Andrew