You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Sean Busbey (JIRA)" <ji...@apache.org> on 2015/11/19 14:53:11 UTC

[jira] [Commented] (AVRO-1641) parser.java stack expansion probably not as intended

    [ https://issues.apache.org/jira/browse/AVRO-1641?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15013568#comment-15013568 ] 

Sean Busbey commented on AVRO-1641:
-----------------------------------

This sounds reasonable. If you can post a patch I'm happy to review. A benchmark of some kind showing the impact would help.

> parser.java stack expansion probably not as intended
> ----------------------------------------------------
>
>                 Key: AVRO-1641
>                 URL: https://issues.apache.org/jira/browse/AVRO-1641
>             Project: Avro
>          Issue Type: Bug
>    Affects Versions: 1.7.7, 1.8.0
>            Reporter: Zoltan Farkas
>            Priority: Minor
>
> at Parser.java line 65 (https://github.com/apache/avro/blob/trunk/lang/java/avro/src/main/java/org/apache/avro/io/parsing/Parser.java#L65): 
>  private void expandStack() {
>     stack = Arrays.copyOf(stack, stack.length+Math.max(stack.length,1024));
>   }
> should probably be:
> private void expandStack() {
>     stack = Arrays.copyOf(stack, stack.length+Math.min(stack.length,1024));
>   }
> This expansion probably is intended to grow exponentially up to 1024, and not exponentially after 1024...



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)