lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikemcc...@apache.org
Subject svn commit: r932398 - in /lucene/dev/trunk/lucene: CHANGES.txt src/java/org/apache/lucene/analysis/Tokenizer.java src/java/org/apache/lucene/index/DocInverterPerField.java
Date Fri, 09 Apr 2010 13:12:06 GMT
Author: mikemccand
Date: Fri Apr  9 13:12:06 2010
New Revision: 932398

URL: http://svn.apache.org/viewvc?rev=932398&view=rev
Log:
LUCENE-2387: don't hang onto Fieldable of last doc indexed in IW, nor to Reader in Tokenizer
after close is called

Modified:
    lucene/dev/trunk/lucene/CHANGES.txt
    lucene/dev/trunk/lucene/src/java/org/apache/lucene/analysis/Tokenizer.java
    lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/DocInverterPerField.java

Modified: lucene/dev/trunk/lucene/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/CHANGES.txt?rev=932398&r1=932397&r2=932398&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/CHANGES.txt (original)
+++ lucene/dev/trunk/lucene/CHANGES.txt Fri Apr  9 13:12:06 2010
@@ -258,6 +258,10 @@ Bug fixes
 * LUCENE-2074: Reduce buffer size of lexer back to default on reset.
   (Ruben Laguna, Shai Erera via Uwe Schindler)
   
+* LUCENE-2387: Don't hang onto Fieldables from the last doc indexed,
+  in IndexWriter, nor the Reader in Tokenizer after close is
+  called.  (Ruben Laguna, Uwe Schindler, Mike McCandless)
+
 New features
 
 * LUCENE-2128: Parallelized fetching document frequencies during weight

Modified: lucene/dev/trunk/lucene/src/java/org/apache/lucene/analysis/Tokenizer.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/src/java/org/apache/lucene/analysis/Tokenizer.java?rev=932398&r1=932397&r2=932398&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/src/java/org/apache/lucene/analysis/Tokenizer.java (original)
+++ lucene/dev/trunk/lucene/src/java/org/apache/lucene/analysis/Tokenizer.java Fri Apr  9
13:12:06 2010
@@ -67,7 +67,12 @@ public abstract class Tokenizer extends 
   /** By default, closes the input Reader. */
   @Override
   public void close() throws IOException {
-    input.close();
+    if (input != null) {
+      input.close();
+      // LUCENE-2387: don't hold onto Reader after close, so
+      // GC can reclaim
+      input = null;
+    }
   }
   
   /** Return the corrected offset. If {@link #input} is a {@link CharStream} subclass

Modified: lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/DocInverterPerField.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/DocInverterPerField.java?rev=932398&r1=932397&r2=932398&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/DocInverterPerField.java (original)
+++ lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/DocInverterPerField.java Fri
Apr  9 13:12:06 2010
@@ -199,6 +199,10 @@ final class DocInverterPerField extends 
           fieldState.offset += docState.analyzer.getOffsetGap(field);
         fieldState.boost *= field.getBoost();
       }
+
+      // LUCENE-2387: don't hang onto the field, so GC can
+      // reclaim
+      fields[i] = null;
     }
 
     consumer.finish();



Mime
View raw message