Skip to content

Apache Lucene open-source search software

LUCENE-3892: null these massive static data structures out so they can be GC'ed and wont OOM tests

Robert Muirab2a7e389f82
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestPostingsFormat.java b/lucene/core/src/test/org/apache/lucene/index/TestPostingsFormat.java
index d1c59c67075..672829c55f9 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestPostingsFormat.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestPostingsFormat.java
@@ -43,6 +43,7 @@ import org.apache.lucene.util.Constants;
import org.apache.lucene.util.FixedBitSet;
import org.apache.lucene.util.LuceneTestCase;
import org.apache.lucene.util._TestUtil;
+import org.junit.AfterClass;
import org.junit.BeforeClass;
/* NOTE: This test focuses on the postings
@@ -315,6 +316,15 @@ public class TestPostingsFormat extends LuceneTestCase {
System.out.println("TEST: done init postings; maxDocID=" + maxDocID + "; " + allTerms.size() + " total terms, across " + fieldInfos.size() + " fields");
}
}
+
+ @AfterClass
+ public static void afterClass() throws Exception {
+ allTerms = null;
+ fieldInfos = null;
+ fields = null;
+ fieldsLive = null;
+ globalLiveDocs = null;
+ }
// TODO maybe instead of @BeforeClass just make a single test run: build postings & index & test it?