Github user srowen commented on a diff in the pull request:
https://github.com/apache/spark/pull/19460#discussion_r143571046
--- Diff:
common/unsafe/src/main/java/org/apache/spark/unsafe/array/ByteArrayMethods.java
---
@@ -40,6 +40,15 @@ public static int roundNumberOfBytesToNearestWord(int
numBytes) {
}
}
+ // Some JVMs can't allocate arrays of length Integer.MAX_VALUE; actual
max is somewhat smaller.
+ // Be conservative and lower the cap a little.
+ public static int MAX_ARRAY_LENGTH = Integer.MAX_VALUE - 8;
--- End diff --
I get declaring a constant though it doesn't just pertain to byte arrays. I
couldn't find a good place for it. I don't know if its reused so much that it
needs this
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]