[antlr-interest] Java.lang.OutOfMemoryError with 3.0b5 but not 3.0b4

Terence Parr parrt at cs.usfca.edu
Sun Nov 19 14:32:29 PST 2006


Hi Brendan,

  as I've mentioned to a few other people, I have removed a failsafe  
that I thought was a needed.  For large grammars, ANTLR will take too  
long to decide that one of your decisions has multiple recursive  
alternatives.  Turn on -Xwatchconversion and it will tell you which  
one has the problem. look for common left factors that are very large  
rules and/or recursive. can you privately send me the grammar?

Ter

On Nov 19, 2006, at 2:14 PM, Brendan Babb wrote:

> Hi,
>
> I have a grammar based on a mix the ECMA script one and Java 1.5 one.
> This compiles without issues using 3.0b4. I'm trying to move to 3.0b5
> and I get OOM errors. If I increase the max heap size (java - 
> Xmx1024M),
> antlr seems to go into an infinite loop.
>
> Given that this does work on 3.0b4, I guess there is a bug in  
> 3.0b5. Any
> suggestions as to how to help track the problem down, or the sorts of
> grammar rules to avoid?
>
> Thanks,
> Brendan



More information about the antlr-interest mailing list