Bugs item #972992, was opened at 2004-06-15 07:49
Message generated for change (Comment added) made by dashorst
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=497982&aid=972992&group_id=61302
Category: None
Group: Release 1.3
>Status: Pending
Resolution: Fixed
Priority: 7
Submitted By: Budi Boentaran (budib)
Assigned to: Vivek Venugopalan (vivekv)
Summary: Memory Leak
Initial Comment:
Hi,
We have one test Suite that holds all the test cases.
When running the test Suite, we realize that the
memory usage is keep increasing.
To solve the problem, we implement tearDown in
WebTestCase to set the WebTester instance to null,
thus allowing the gc to reclaim the memory.
public class WebTestCase extends TestCase {
protected WebTester tester;
/**
* Implement tearDown method to clear unused
memory
*/
protected void tearDown() throws Exception {
//Set the reference to null
//to allow the GC to clear the memory
tester = null;
}
----------------------------------------------------------------------
>Comment By: Martijn Dashorst (dashorst)
Date: 2004-07-03 18:44
Message:
Logged In: YES
user_id=695103
instead of overriding tearDown(), runBare is overridden, and
the allocation of webtester is postponed until just before
setUp is called.
----------------------------------------------------------------------
Comment By: Martijn Dashorst (dashorst)
Date: 2004-06-29 00:36
Message:
Logged In: YES
user_id=695103
see the development mailinglist for more information on the
discussion of this 'bug'.
----------------------------------------------------------------------
Comment By: Martijn Dashorst (dashorst)
Date: 2004-06-28 22:36
Message:
Logged In: YES
user_id=695103
The problem with this fix is that you 'force' a subclasser
of WebTestCase to call super.tearDown(). This is *not* a
normal JUnit practice.
I'll look into the junit framework for a more elegant solution.
----------------------------------------------------------------------
Comment By: Vivek Venugopalan (vivekv)
Date: 2004-06-17 19:52
Message:
Logged In: YES
user_id=131737
OK you convinced me :) I will make the change and commit
to CVS.
----------------------------------------------------------------------
Comment By: Budi Boentaran (budib)
Date: 2004-06-17 04:52
Message:
Logged In: YES
user_id=1063581
Hi,
Yes it helps. By setting it to null, the GC can reclaim back the
memory when each test case is finished. It will not force the
GC to do garbage collection immediately, but just allowing it
to claim back the memory when needed.
Previously the GC will not be able to reclaim the memory until
the whole test suite is finishes. For our case, our test suite
contains more than 1000 test cases, thus the JVM is running
out of memory after running few hundred test cases.
----------------------------------------------------------------------
Comment By: Vivek Venugopalan (vivekv)
Date: 2004-06-17 04:26
Message:
Logged In: YES
user_id=131737
Did this help? Typically even if we set the memory to null,
this is just a hint to the GC to force garbage collection. In
any case, was the leak somewhere else? This change is
simple and possibly has no side effects but I want to make
sure that the leak is in jWebUnit.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=497982&aid=972992&group_id=61302
-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 -
digital self defense, top technical experts, no vendor pitches,
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
Jwebunit-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jwebunit-development