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

Randall R Schulz rschulz at sonic.net
Sun Jul 15 07:44:45 PDT 2007


On Sunday 15 July 2007 07:33, ali azimi wrote:
>  Hello,
>
> I am still not able to increase the heap space. I keep getting
> "java.lang.OutOfMemoryError: Java heap space" error message once I
> click on the debugger. I use the the command "java -Xms32m -Xmx512m
> org.antlr.Tool RFC3986.g" but then face the following error message:
> "Exception in thread "main"
> java.lang.NoClassDefFoundError:org/antlr/Tool". I use
> ANTLRWorks_1.0.201.
> Could you please suggest me an easy way of sorting this
> out(increasing the heap space). I will be very grateful.

You're not dealing with an out-of-memory condition. You're invoking the 
JVM without properly telling it where your ANTLR libraries (JAR files) 
are located.

Please show us the command you're using to attempt to launch ANTLRWorks 
with the -X options. If it's literally the one you gave above:

    java -Xms32m -Xmx512m org.antlr.Tool RFC3986.g

Then of course it won't work. You must include a -classpath ... 
or -cp ... option to tell Java where to find the ANTLR classes.

It appears nothing has changed since your last message on this topic.

I'll repeat this advice I gave you then:

On Friday 13 July 2007 09:24, Randall R Schulz wrote:
> How were you invoking ANTLR before? Some script? It will have the
> necessary class-path argument that you'll need to include.
>
> Alternately, you can just modify that script to have the heap limit
> options or to be able to accept such options on its command line.


> ...
> Al


Randall Schulz


More information about the antlr-interest mailing list