[antlr-interest] Memory issue with ANTLR

Jayani Withanawasam jayaniw at ecollege.com
Wed Jun 1 04:02:49 PDT 2011


Hi,

 

I get a java.lang.OutOfMemoryError: (Java heap space) in ANTLR 3.3 and
ANTLR 3.1.3. (Project properties)

I need to increase the max heap size of the JVM.

 

So, I used the following command in Visual Studio pre-build event
command line:

 

java -cp
"D:\Jay_CC\P4\user\brettp\SQLStandardsChecker\Ecollege\CodeStandards\ext
\ANTLR\lib\antlr-3.3-complete.jar" -Xms32M -Xmx512M org.antlr.Tool
-message-format vs2005 -Xconversiontimeout 30000
"D:\Jay_CC\P4\user\brettp\SQLStandardsChecker\Ecollege\CodeStandards\Par
ser\tsqllexer.g"
"D:\Jay_CC\P4\user\brettp\SQLStandardsChecker\Ecollege\CodeStandards\Par
ser\tsql.g"
"D:\Jay_CC\P4\user\brettp\SQLStandardsChecker\Ecollege\CodeStandards\Par
ser\tsqlwalker.g"

 

When I applied this I get namespace/ reference issues related to grammar
files.

Ex: 

The type or namespace name 'IAstRuleReturnScope' could not be found (are
you missing a using directive or an assembly reference?)
D:\Jay_CC\P4\user\brettp\SQLStandardsChecker\Ecollege\CodeStandards\Pars
er\tsql_tsqlcursors.cs  875                69           Parser

 

Also, I tried following command in the command prompt.

 

Java -Xms32M -Xmx512M org.antlr.tool
"D:\Jay_CC\P4\user\brettp\SQLStandardsChecker\Ecollege\CodeStandards\Par
ser\tsqllexer.g"
"D:\Jay_CC\P4\user\brettp\SQLStandardsChecker\Ecollege\CodeStandards\Par
ser\tsql.g"
"D:\Jay_CC\P4\user\brettp\SQLStandardsChecker\Ecollege\CodeStandards\Par
ser\tsqlwalker.g"

 

There I got a timeout issue.

 

Is the given command incorrect? If so, what is the correct command I
should give to,

1.       Set the class path variable

2.       Increase the JVM heap size

 

Is there any other solution/ workaround for this time out issue?

Do you have any thoughts on this? Appreciate your help.

 

Regards,

Jayani 

 



More information about the antlr-interest mailing list