Copilot commented on code in PR #3865:
URL: https://github.com/apache/avro/pull/3865#discussion_r3567429785
##########
lang/java/avro/src/main/java/org/apache/avro/SystemLimitException.java:
##########
@@ -153,6 +187,19 @@ private static long defaultMaxDecompressLength() {
Math.max(1L, Runtime.getRuntime().maxMemory() /
DEFAULT_MAX_DECOMPRESS_HEAP_FRACTION));
}
+ /**
+ * Calculate the default maximum number of zero-byte-encoded array elements
to
+ * allocate at once, as a fraction of the maximum heap. Such elements
consume no
+ * input bytes, so the usual "bytes remaining" bound does not apply and the
+ * allocation must instead be capped relative to the available memory.
Review Comment:
The Javadoc for defaultMaxCollectionAllocation() still says
"zero-byte-encoded" elements, but the allocation cap is used for schemas whose
*minimum encoded size is zero* (which can include some recursive schemas where
the minimum is conservatively treated as 0). Rewording keeps the internal docs
consistent with the public property/Javadoc and the predicate used by
isZeroByteSchema/minBytesPerElement.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]