encourage early GC

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@17832 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
kohsuke committed 2009-05-07 18:23:52 +00:00
1 parent f8644cf5a8
commit 88895e7eef
1 file changed
+6
@@ -226,6 +226,12 @@ public abstract class HudsonTestCase extends TestCase {
env.dispose();
ExtensionList.clearLegacyInstances();
DescriptorExtensionList.clearLegacyInstances();
// Hudson creates ClassLoaders for plugins that hold on to file descriptors of its jar files,
// but because there's no explicit dispose method on ClassLoader, they won't get GC-ed until
// at some later point, leading to possible file descriptor overflow. So encourage GC now.
// see http://bugs.sun.com/view_bug.do?bug_id=4950148
System.gc();
}
protected void runTest() throws Throwable {