Xtext: What does this exception mean?

心不动则不痛 提交于 2019-12-25 08:48:34

问题


I have a Xtext grammar which throws following exception when I try to generate Xtext artifacts (It starts and in the end it throws the exception(s)).
My Outline (first few lines):

0    [main] INFO  lipse.emf.mwe.utils.StandaloneSetup  - Registering platform uri 'C:\Users\Robert Adam\Documents\eclipse.luna\workspace'
451  [main] INFO  lipse.emf.mwe.utils.StandaloneSetup  - Adding generated EPackage 'org.eclipse.xtext.xbase.XbasePackage'
701  [main] INFO  clipse.emf.mwe.utils.GenModelHelper  - Registered GenModel 'http://www.eclipse.org/Xtext/Xbase/XAnnotations' from 'platform:/resource/org.eclipse.xtext.xbase/model/Xbase.genmodel'
701  [main] INFO  clipse.emf.mwe.utils.GenModelHelper  - Registered GenModel 'http://www.eclipse.org/xtext/xbase/Xtype' from 'platform:/resource/org.eclipse.xtext.xbase/model/Xbase.genmodel'
717  [main] INFO  clipse.emf.mwe.utils.GenModelHelper  - Registered GenModel 'http://www.eclipse.org/xtext/xbase/Xbase' from 'platform:/resource/org.eclipse.xtext.xbase/model/Xbase.genmodel'
717  [main] INFO  clipse.emf.mwe.utils.GenModelHelper  - Registered GenModel 'http://www.eclipse.org/xtext/common/JavaVMTypes' from 'platform:/resource/org.eclipse.xtext.common.types/model/JavaVMTypes.genmodel'
1904 [main] INFO  lipse.emf.mwe.utils.StandaloneSetup  - Adding generated EPackage 'org.eclipse.xtext.common.types.TypesPackage'
1916 [main] INFO  ipse.emf.mwe.utils.DirectoryCleaner  - Cleaning C:\Users\Robert Adam\Documents\eclipse.luna\workspace\raven.sqf\..\raven.sqf\src-gen
2076 [main] INFO  ipse.emf.mwe.utils.DirectoryCleaner  - Cleaning C:\Users\Robert Adam\Documents\eclipse.luna\workspace\raven.sqf\..\raven.sqf\model\generated
2077 [main] INFO  ipse.emf.mwe.utils.DirectoryCleaner  - Cleaning C:\Users\Robert Adam\Documents\eclipse.luna\workspace\raven.sqf\..\raven.sqf.ui\src-gen
2081 [main] INFO  ipse.emf.mwe.utils.DirectoryCleaner  - Cleaning C:\Users\Robert Adam\Documents\eclipse.luna\workspace\raven.sqf\..\raven.sqf.tests\src-gen
8449 [main] INFO  clipse.emf.mwe.utils.GenModelHelper  - Registered GenModel 'http://www.SQF.raven' from 'platform:/resource/raven.sqf/model/generated/SQF.genmodel'
164592 [main] INFO  text.generator.junit.Junit4Fragment  - generating Junit4 Test support classes
164692 [main] INFO  text.generator.junit.Junit4Fragment  - generating Compare Framework infrastructure
164707 [main] ERROR mf.mwe2.launch.runtime.Mwe2Launcher  - Problems running workflow raven.GenerateSQF: 
[ERROR]: GeneratorException: (Element: -UNKNOWN-; Reported by: Generator)
     org.eclipse.emf.common.util.WrappedException: java.lang.reflect.InvocationTargetException
    at org.eclipse.xtext.generator.parser.antlr.AntlrToolFacade.runWithEncodingAndParams(AntlrToolFacade.java:183)
    at org.eclipse.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment.generate(XtextAntlrGeneratorFragment.java:48)
    at org.eclipse.xtext.generator.DefaultGeneratorFragment.generate(DefaultGeneratorFragment.java:167)
    at org.eclipse.xtext.generator.CompositeGeneratorFragment.generate(CompositeGeneratorFragment.java:163)
    at org.eclipse.xtext.generator.Generator.generate(Generator.java:555)
    at org.eclipse.xtext.generator.Generator.invokeInternal(Generator.java:172)
    at org.eclipse.emf.mwe.core.lib.AbstractWorkflowComponent.invoke(AbstractWorkflowComponent.java:126)
    at org.eclipse.emf.mwe.core.lib.Mwe2Bridge.invoke(Mwe2Bridge.java:34)
    at org.eclipse.emf.mwe.core.lib.AbstractWorkflowComponent.invoke(AbstractWorkflowComponent.java:201)
    at org.eclipse.emf.mwe2.runtime.workflow.AbstractCompositeWorkflowComponent.invoke(AbstractCompositeWorkflowComponent.java:35)
    at org.eclipse.emf.mwe2.runtime.workflow.Workflow.run(Workflow.java:19)
    at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:102)
    at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:62)
    at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:52)
    at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.run(Mwe2Launcher.java:78)
    at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.main(Mwe2Launcher.java:36)
Caused by: java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.eclipse.xtext.generator.parser.antlr.AntlrToolFacade.runWithEncodingAndParams(AntlrToolFacade.java:173)
    ... 15 more
Caused by: java.lang.OutOfMemoryError: GC overhead limit exceeded
    at java.util.HashMap.newTreeNode(Unknown Source)
    at java.util.HashMap$TreeNode.putTreeVal(Unknown Source)
    at java.util.HashMap.putVal(Unknown Source)
    at java.util.HashMap.put(Unknown Source)
    at java.util.HashSet.add(Unknown Source)
    at org.antlr.misc.OrderedHashSet.add(OrderedHashSet.java:63)
    at org.antlr.analysis.DFAState.addNFAConfiguration(DFAState.java:226)
    at org.antlr.analysis.NFAToDFAConverter.closure(NFAToDFAConverter.java:633)
    at org.antlr.analysis.NFAToDFAConverter.closure(NFAToDFAConverter.java:709)
    at org.antlr.analysis.NFAToDFAConverter.closure(NFAToDFAConverter.java:709)
    at org.antlr.analysis.NFAToDFAConverter.closure(NFAToDFAConverter.java:683)
    at org.antlr.analysis.NFAToDFAConverter.closure(NFAToDFAConverter.java:709)
    at org.antlr.analysis.NFAToDFAConverter.closure(NFAToDFAConverter.java:709)
    at org.antlr.analysis.NFAToDFAConverter.closure(NFAToDFAConverter.java:765)
    at org.antlr.analysis.NFAToDFAConverter.closure(NFAToDFAConverter.java:709)
    at org.antlr.analysis.NFAToDFAConverter.closure(NFAToDFAConverter.java:709)
    at org.antlr.analysis.NFAToDFAConverter.closure(NFAToDFAConverter.java:683)
    at org.antlr.analysis.NFAToDFAConverter.closure(NFAToDFAConverter.java:709)
    at org.antlr.analysis.NFAToDFAConverter.closure(NFAToDFAConverter.java:709)
    at org.antlr.analysis.NFAToDFAConverter.closure(NFAToDFAConverter.java:709)
    at org.antlr.analysis.NFAToDFAConverter.closure(NFAToDFAConverter.java:683)
    at org.antlr.analysis.NFAToDFAConverter.closure(NFAToDFAConverter.java:709)
    at org.antlr.analysis.NFAToDFAConverter.closure(NFAToDFAConverter.java:709)
    at org.antlr.analysis.NFAToDFAConverter.closure(NFAToDFAConverter.java:765)
    at org.antlr.analysis.NFAToDFAConverter.closure(NFAToDFAConverter.java:765)
    at org.antlr.analysis.NFAToDFAConverter.closure(NFAToDFAConverter.java:765)
    at org.antlr.analysis.NFAToDFAConverter.closure(NFAToDFAConverter.java:709)
    at org.antlr.analysis.NFAToDFAConverter.closure(NFAToDFAConverter.java:709)
    at org.antlr.analysis.NFAToDFAConverter.closure(NFAToDFAConverter.java:683)
    at org.antlr.analysis.NFAToDFAConverter.closure(NFAToDFAConverter.java:709)
    at org.antlr.analysis.NFAToDFAConverter.closure(NFAToDFAConverter.java:709)
    at org.antlr.analysis.NFAToDFAConverter.closure(NFAToDFAConverter.java:709)

My guess is that the problem is caused by an issue with the memory...Is this correct? And if so how can I avoid this?

Best regards Raven


回答1:


The GC throws this exception when too much time is spent in garbage collection for too little return, eg. 98% of CPU time is spent on GC and less than 2% of heap is recovered.

This feature is designed to prevent applications from running for an extended period of time while making little or no progress because the heap is too small.

You can either try to increase the size of the heap with -Xmx1g (sets the heap to 1 gigabyte)

Or you can just turn this off with the command line option -XX:-UseGCOverheadLimit which hides the symptom, but does not fix the problem.

This feature is detailed on here: http://www.oracle.com/technetwork/java/javase/gc-tuning-6-140523.html#par_gc.oom



来源:https://stackoverflow.com/questions/32022966/xtext-what-does-this-exception-mean

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!