db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kathey Marsden <kmarsdende...@sbcglobal.net>
Subject JUnit memory consumption
Date Mon, 22 Oct 2007 20:00:51 GMT
Upon more research it seems that JUnit creates one instance of each test 
class per fixture and keeps that reference until the end of the 
suites.All run.  That means any state in the test hangs around as well, 
which slowly adds up as the test runs. This is particularly problematic 
for tests such as ClosedObjectTest which ends up with 3150 instances + 
state for each:
 
Options to reduce footprint include:
- Make sure tests have tearDown() methods that null out fields.
-  Rework  tests such as ClosedObjectTest  to not have so many fixtures.
- Make a request to JUnit that the Suite  dereferences the test after it 
runs.
- Make the tearDown method in BaseJDBCTest null out fields. (I think 
this means that fields for tests would have to be public.)
- Something else?

Thoughts on this are greatly appreciated.

Kathey









Mime
View raw message