Index: src/java/org/apache/lucene/analysis/Tokenizer.java =================================================================== --- src/java/org/apache/lucene/analysis/Tokenizer.java (revision 918466) +++ src/java/org/apache/lucene/analysis/Tokenizer.java (working copy) @@ -68,7 +68,12 @@ /** By default, closes the input Reader. */ 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 Index: src/java/org/apache/lucene/index/DocInverterPerField.java =================================================================== --- src/java/org/apache/lucene/index/DocInverterPerField.java (revision 918466) +++ src/java/org/apache/lucene/index/DocInverterPerField.java (working copy) @@ -202,6 +202,10 @@ 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();