Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Large grammar - "heap space" error - but ends by 'done'
Large grammar - "heap space" error - but ends by 'done' [message #1769454] Mon, 31 July 2017 14:58 Go to next message
Eclipse UserFriend
Hi XText users and gurus,

I have defined a grammar that is pretty large: about 1500 lines. In complexity it can be regarded as something of the magnitude of Java 7.

When generating the artifacts, it ends by 'done' as the process were succeeding; but just before the end, this error occurs:

error(10):  internal error: Can't get property javaCompressedTransition using method get/isJavaCompressedTransition from org.antlr.analysis.DFA instance : java.lang.OutOfMemoryError: Java heap space
java.util.ArrayList.<init>(ArrayList.java:152)
org.antlr.analysis.DFA.getRunLengthEncoding(DFA.java:357)
org.antlr.analysis.DFA.getJavaCompressedTransition(DFA.java:333)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:498)
org.antlr.stringtemplate.language.ASTExpr.invokeMethod(ASTExpr.java:564)
org.antlr.stringtemplate.language.ASTExpr.rawGetObjectProperty(ASTExpr.java:515)
org.antlr.stringtemplate.language.ASTExpr.getObjectProperty(ASTExpr.java:417)
org.antlr.stringtemplate.language.ActionEvaluator.attribute(ActionEvaluator.java:351)
org.antlr.stringtemplate.language.ActionEvaluator.expr(ActionEvaluator.java:136)
org.antlr.stringtemplate.language.ActionEvaluator.templateApplication(ActionEvaluator.java:216)
org.antlr.stringtemplate.language.ActionEvaluator.expr(ActionEvaluator.java:126)
org.antlr.stringtemplate.language.ActionEvaluator.action(ActionEvaluator.java:84)
org.antlr.stringtemplate.language.ASTExpr.write(ASTExpr.java:149)
org.antlr.stringtemplate.StringTemplate.write(StringTemplate.java:705)
org.antlr.stringtemplate.language.ASTExpr.writeTemplate(ASTExpr.java:750)
org.antlr.stringtemplate.language.ASTExpr.write(ASTExpr.java:680)
org.antlr.stringtemplate.language.ASTExpr.writeIterableValue(ASTExpr.java:772)
org.antlr.stringtemplate.language.ASTExpr.write(ASTExpr.java:682)
org.antlr.stringtemplate.language.ASTExpr.writeAttribute(ASTExpr.java:660)
org.antlr.stringtemplate.language.ActionEvaluator.action(ActionEvaluator.java:86)
org.antlr.stringtemplate.language.ASTExpr.write(ASTExpr.java:149)
org.antlr.stringtemplate.StringTemplate.write(StringTemplate.java:705)
org.antlr.stringtemplate.language.ASTExpr.writeTemplate(ASTExpr.java:750)
org.antlr.stringtemplate.language.ASTExpr.write(ASTExpr.java:680)
org.antlr.stringtemplate.language.ASTExpr.writeAttribute(ASTExpr.java:660)
org.antlr.stringtemplate.language.ActionEvaluator.action(ActionEvaluator.java:86)
org.antlr.stringtemplate.language.ASTExpr.write(ASTExpr.java:149)
org.antlr.stringtemplate.StringTemplate.write(StringTemplate.java:705)
org.antlr.codegen.CodeGenerator.write(CodeGenerator.java:1281)


Is this a real error?
Any clues how to overcome this?
I've tried to instruct Eclipse to use about 2Gb of heap space (xms, xmx options), but even that did not help.

Thanks in advance!

PS: the error appears after adding a clause like:

=>( ',' Expression)?

... to a rule that is situated pretty high/early in the top-down derivation tree.
Re: Large grammar - "heap space" error - but ends by 'done' [message #1769462 is a reply to message #1769454] Mon, 31 July 2017 15:22 Go to previous messageGo to next message
Eclipse UserFriend
Hi what did you exactly do to increase xmx? Adapt the launch config of the mwe2 file?
Re: Large grammar - "heap space" error - but ends by 'done' [message #1769463 is a reply to message #1769462] Mon, 31 July 2017 15:24 Go to previous messageGo to next message
Eclipse UserFriend
Uups, er, no. I've just edited the eclipse.ini file...
Re: Large grammar - "heap space" error - but ends by 'done' [message #1769464 is a reply to message #1769462] Mon, 31 July 2017 15:38 Go to previous messageGo to next message
Eclipse UserFriend
Christian Dietrich wrote on Mon, 31 July 2017 19:22
Hi what did you exactly do to increase xmx? Adapt the launch config of the mwe2 file?


I don't get you, sorry. What file do you advise me to change?
Re: Large grammar - "heap space" error - but ends by 'done' [message #1769466 is a reply to message #1769464] Mon, 31 July 2017 15:42 Go to previous messageGo to next message
Eclipse UserFriend
Run menu
Run configurations
Select "generate mydsl (mydsl) language infrastructure " under mwe2 launch
Go to arguments tab
Adapt value for xmx
Run
Re: Large grammar - "heap space" error - but ends by 'done' [message #1769468 is a reply to message #1769466] Mon, 31 July 2017 15:49 Go to previous message
Eclipse UserFriend
Christian Dietrich wrote on Mon, 31 July 2017 19:42
Run menu
Run configurations
Select "generate mydsl (mydsl) language infrastructure " under mwe2 launch
Go to arguments tab
Adapt value for xmx
Run


Maaan, that did the trick. Thank you A DAMN LOT.
Previous Topic:Unresolved proxies
Next Topic:Defining subtypes without unsigned rule calls
Goto Forum:
  


Current Time: Fri Jul 25 01:40:59 EDT 2025

Powered by FUDForum. Page generated in 0.03411 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top