[antlr-interest] Memory issue with ANTLR

Mark Wright markwright at internode.on.net
Wed Jun 1 05:30:35 PDT 2011

On Wed, 1 Jun 2011 17:24:21 +0530, Jayani Withanawasam <jayaniw at ecollege.com> wrote:
> Thanks Mark,
> The issue is the following command seems to be incorrect:
> 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"
> The timeout is set to 30000 here. But how to increase the max heap size
> in this command?
> Regards,
> Jayani.

Hi Jayani,

It looks like you may have already increased the max heap size with the
-Xms32M -Xmx512M options, I guess java does not care if its M or m for
megabytes, I use m, like:

java -Xmx512m -classpath $(ANTLR_CLASSPATH) org.antlr.Tool -Xconversiontimeout 1200000 -report mygrammar.g

Anyway back in your first email, it looked like you sort of got past
that when running it in visual studio, and instead got this error:

> 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

But I don't know how to fix this error (I don't know if IAstRuleReturnScope is
something in your code or the C# ANTLR runtime).

Regards, Mark

More information about the antlr-interest mailing list