[antlr-interest] Out of memory error

Mark Bednarczyk voytechs at yahoo.com
Wed Mar 14 15:33:28 PDT 2007


I keep getting the out of heap memory error under certain conditions, and
I've been trying to figure out how to specify vmargs to the ANTLR3 task so
that I can increase the defaul 64mb to something like 512mb. Anyone know how
to do that. ANTLR3 task doesn't provide any VM options. I did verify that
ANT spawns a new java VM to run the subtask for org.antlr.Tool with process
explorer.
 
Buildfile: C:\jnetstream\NplLanguage\grammar.xml
     [echo] pulling in property files
grammar:
     [echo] grammar
[antlr:antlr3] ANTLR Parser Generator  Version 3.0b6 (Jan 31, 2007)
1989-2007
[antlr:antlr3] Exception in thread "main" java.lang.OutOfMemoryError: Java
heap space
[antlr:antlr3] at java.util.Arrays.copyOf(Arrays.java:2882)
[antlr:antlr3] at
java.lang.AbstractStringBuilder.expandCapacity(AbstractStringBuilder.java:10
0)
[antlr:antlr3] at
java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:390)
[antlr:antlr3] at java.lang.StringBuffer.append(StringBuffer.java:224)
[antlr:antlr3] at java.io.StringWriter.write(StringWriter.java:84)
[antlr:antlr3] at
org.antlr.stringtemplate.AutoIndentWriter.indent(AutoIndentWriter.java:208)
[antlr:antlr3] at
org.antlr.stringtemplate.AutoIndentWriter.write(AutoIndentWriter.java:133)


Here is the rule that triggers this error. If I comment out the second
alternative, I don't run out of memory:

tableBody
	:	('{' tableConstant)
		=> ('{' tableConstants blockStatement* '}')
		-> ^(SLIST tableConstants+)
		
	|	'{' blockStatement* '}'
	;

Cheers,
mark...




More information about the antlr-interest mailing list