Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

LUCENE-5844: use RUE.NUM_BYTES_ARRAY_HEADER instead of 8

Michael McCandless6b5f5bab084d
diff --git a/lucene/core/src/java/org/apache/lucene/util/ArrayUtil.java b/lucene/core/src/java/org/apache/lucene/util/ArrayUtil.java
index b64a682ab86..c7501386bb5 100644
--- a/lucene/core/src/java/org/apache/lucene/util/ArrayUtil.java
+++ b/lucene/core/src/java/org/apache/lucene/util/ArrayUtil.java
@@ -28,10 +28,8 @@ import java.util.Comparator;
public final class ArrayUtil {
- /** Maximum length for an array (Integer.MAX_VALUE - 8). stackoverflow
- * consensus seems to be this value and it's also what ArrayList.java
- * uses as its limit. */
- public static final int MAX_ARRAY_LENGTH = Integer.MAX_VALUE - 8;
+ /** Maximum length for an array (Integer.MAX_VALUE - RamUsageEstimator.NUM_BYTES_ARRAY_HEADER). */
+ public static final int MAX_ARRAY_LENGTH = Integer.MAX_VALUE - RamUsageEstimator.NUM_BYTES_ARRAY_HEADER;
private ArrayUtil() {} // no instance