[antlr-interest] "java.lang.OutOfMemoryError: Java heap space" error message (newbie)

Randall R Schulz rschulz at sonic.net
Sun Jul 15 09:33:58 PDT 2007


On Sunday 15 July 2007 09:17, ali azimi wrote:
>   Hi,
>
>   I apologise for not explaining my problem clearly. I use
> ANTLRWorks. ANTLRWorks exceeds its heap allocation when I try to
> debug the grammar I have produced. I do not know how to launch
> ANTLRWorks with –X
 memory option. Could you please tell me how?

OK.

Since you obviously know where your ANTLRWorks JAR file is (you said 
you've been launching it by double-clicking its desktop icon (*)), so 
for the sake of concreteness, let's say its absolute path name 
is "C:/AW/antlrworks-1.0.2.jar" (make life easier for yourself and use 
forward slashes even under Windows--they'll work there just as they do 
on Unix and Unix-like systems).

(*) If you're launching ANTLRWorks via a desktop shortcut, you'll need 
to find the target of the shortcut, not the shortcut itself. Use the 
shortcut's properties dialog to find the full path name of the JAR 
file.

Second, you appear to be able to use a command line to (attempt to) run 
ANTLR, as showed by your previous but as-yet unsuccessful attempts to 
do so.

So using a command-line (CMD.exe if you must, a Cygwin shell if you're 
more fortunately) issue this command:

   java -Xms32m -Xmx512m -jar "C:/AW/antlrworks-1.0.2.jar"


Alternately, you could create a desktop shortcut whose target is this 
command. In this case, use "javaw" instead of "java" (this avoids the 
creation of a character window). Then you can simply double-click this 
icon instead of the one you had been using.


> ...
>   Al


Good luck.

Randall Schulz


More information about the antlr-interest mailing list