lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yo...@apache.org
Subject svn commit: r454434 - in /lucene/java/trunk: CHANGES.txt src/java/org/apache/lucene/index/FieldsReader.java
Date Mon, 09 Oct 2006 17:26:50 GMT
Author: yonik
Date: Mon Oct  9 10:26:49 2006
New Revision: 454434

URL: http://svn.apache.org/viewvc?view=rev&rev=454434
Log:
remove LazyField.chars to reduce memory consumption

Modified:
    lucene/java/trunk/CHANGES.txt
    lucene/java/trunk/src/java/org/apache/lucene/index/FieldsReader.java

Modified: lucene/java/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/java/trunk/CHANGES.txt?view=diff&rev=454434&r1=454433&r2=454434
==============================================================================
--- lucene/java/trunk/CHANGES.txt (original)
+++ lucene/java/trunk/CHANGES.txt Mon Oct  9 10:26:49 2006
@@ -126,6 +126,7 @@
 14. LUCENE-650: Fixed NPE in Locale specific String Sort when Document
     has no value.
     (Oliver Hutchison via Chris Hostetter)
+
     
 Optimizations
 
@@ -152,6 +153,9 @@
      certain level have been accumulated.  This increases indexing performance
      in the presence of deleted docs or partially full segments as well as
      enabling future optimizations. (Ning Li, Yonik Seeley)
+
+  7. Lazy loaded fields unnecessarily retained an extra copy of loaded
+     String data.  (Yonik Seeley)
 
 Test Cases
   1. Added TestTermScorer.java (Grant Ingersoll)

Modified: lucene/java/trunk/src/java/org/apache/lucene/index/FieldsReader.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/index/FieldsReader.java?view=diff&rev=454434&r1=454433&r2=454434
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/index/FieldsReader.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/index/FieldsReader.java Mon Oct  9 10:26:49
2006
@@ -265,9 +265,6 @@
   private class LazyField extends AbstractField implements Fieldable {
     private int toRead;
     private long pointer;
-    //internal buffer
-    private char[] chars;
-
 
     public LazyField(String name, Field.Store store, int toRead, long pointer) {
       super(name, store, Field.Index.NO, Field.TermVector.NO);
@@ -337,10 +334,9 @@
         try {
           localFieldsStream.seek(pointer);
           //read in chars b/c we already know the length we need to read
-          if (chars == null || toRead > chars.length)
-            chars = new char[toRead];
+          char[] chars = new char[toRead];
           localFieldsStream.readChars(chars, 0, toRead);
-          fieldsData = new String(chars, 0, toRead);//fieldsStream.readString();
+          fieldsData = new String(chars);
         } catch (IOException e) {
           throw new FieldReaderException(e);
         }



Mime
View raw message