Copilot commented on code in PR #3865:
URL: https://github.com/apache/avro/pull/3865#discussion_r3567636514


##########
lang/java/avro/src/main/java/org/apache/avro/SystemLimitException.java:
##########
@@ -83,6 +90,34 @@ public class SystemLimitException extends 
AvroRuntimeException {
   public static final long MAX_DECOMPRESS_LENGTH = 
getLongLimitFromProperty(MAX_DECOMPRESS_LENGTH_PROPERTY,
       defaultMaxDecompressLength());
 
+  /**
+   * System property declaring the maximum number of array elements whose 
minimum
+   * encoded size is zero (e.g. {@code null}, a zero-length fixed, a record 
whose
+   * fields are all zero-byte, or a recursive schema conservatively treated as 
a 0
+   * minimum) to allocate at once: {@value}.
+   */
+  public static final String MAX_COLLECTION_ALLOCATION_PROPERTY = 
"org.apache.avro.limits.collectionItems.maxAllocation";
+
+  /**
+   * Fraction of the maximum heap a single decoded collection of zero-byte
+   * elements may occupy by default. Keeps the backing allocation below the 
heap
+   * so a small payload declaring a huge block count cannot exhaust the JVM.
+   */

Review Comment:
   Javadoc wording here says "zero-byte" elements, but this limit is applied 
based on the predicate "minimum encoded size is zero" (which can also be true 
for some recursive schemas where the cycle is conservatively broken with a 0 
minimum). Rewording this sentence keeps the internal docs consistent with the 
public property/Javadoc and the actual condition used by the reader guards.



-- 
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]

Reply via email to