lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikemcc...@apache.org
Subject svn commit: r734967 - /lucene/java/trunk/src/java/org/apache/lucene/index/CheckIndex.java
Date Fri, 16 Jan 2009 10:48:13 GMT
Author: mikemccand
Date: Fri Jan 16 02:48:11 2009
New Revision: 734967

URL: http://svn.apache.org/viewvc?rev=734967&view=rev
Log:
LUCENE-1520: prevent OOM in CheckIndex with large segment that has many fields w/ norms

Modified:
    lucene/java/trunk/src/java/org/apache/lucene/index/CheckIndex.java

Modified: lucene/java/trunk/src/java/org/apache/lucene/index/CheckIndex.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/index/CheckIndex.java?rev=734967&r1=734966&r2=734967&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/index/CheckIndex.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/index/CheckIndex.java Fri Jan 16 02:48:11
2009
@@ -414,7 +414,8 @@
         Iterator it = fieldNames.iterator();
         while(it.hasNext()) {
           final String fieldName = (String) it.next();
-          byte[] b = reader.norms(fieldName);
+          final byte[] b = new byte[reader.maxDoc()];
+          reader.norms(fieldName, b, 0);
           if (b.length != info.docCount)
             throw new RuntimeException("norms for field \"" + fieldName + "\" is length "
+ b.length + " != maxDoc " + info.docCount);
 



Mime
View raw message