From 3e53e6561e50df81881e2e59512db7d7fbbe8ff0 Mon Sep 17 00:00:00 2001 From: Michael McCandless Date: Mon, 17 May 2010 23:12:34 +0000 Subject: [PATCH] LUCENE-2467: fix memory leaks in IW when indexing very large docs git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@945420 13f79535-47bb-0310-9956-ffa450edef68 --- lucene/CHANGES.txt | 3 +++ .../org/apache/lucene/index/DocumentsWriter.java | 15 +++++++++++---- .../java/org/apache/lucene/index/IndexWriter.java | 6 +++++- .../apache/lucene/index/ReusableStringReader.java | 2 ++ .../lucene/index/TermVectorsTermsWriter.java | 2 +- 5 files changed, 22 insertions(+), 6 deletions(-) diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt index c40cf16fb22..4942b7f40d8 100644 --- a/lucene/CHANGES.txt +++ b/lucene/CHANGES.txt @@ -391,6 +391,9 @@ Bug fixes addition, all of IndexComnmit methods which threw UnsupportedOperationException are now abstract. (Shai Erera) +* LUCENE-2467: Fixed memory leaks in IndexWriter when large documents + are indexed. (Mike McCandless) + New features * LUCENE-2128: Parallelized fetching document frequencies during weight diff --git a/lucene/src/java/org/apache/lucene/index/DocumentsWriter.java b/lucene/src/java/org/apache/lucene/index/DocumentsWriter.java index 25a4f71e8c8..d8ce62793bd 100644 --- a/lucene/src/java/org/apache/lucene/index/DocumentsWriter.java +++ b/lucene/src/java/org/apache/lucene/index/DocumentsWriter.java @@ -1314,11 +1314,14 @@ final class DocumentsWriter { } /* Return byte[]'s to the pool */ + @Override void recycleByteBlocks(byte[][] blocks, int start, int end) { synchronized(DocumentsWriter.this) { - for(int i=start;i blocks) { synchronized(DocumentsWriter.this) { final int size = blocks.size(); - for(int i=0;i