From ab2a7e389f82969b2e463abf4fab02b4253b8b6c Mon Sep 17 00:00:00 2001 From: Robert Muir <rmuir@apache.org> Date: Tue, 24 Jul 2012 19:49:32 +0000 Subject: [PATCH] LUCENE-3892: null these massive static data structures out so they can be GC'ed and wont OOM tests git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1365257 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/lucene/index/TestPostingsFormat.java | 10 ++++++++++ 1 file changed, 10 insertions(+) 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?