这个异常是什么意思

这个异常是什么意思

本文介绍了Xtext:这个异常是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 Xtext 语法,当我尝试生成 Xtext 工件时会抛出以下异常(它开始并最终抛出异常).
我的大纲(前几行):

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?

最好的问候乌鸦

推荐答案

当垃圾收集花费太多时间而返回太少时,GC 会抛出此异常,例如.98% 的 CPU 时间花在 GC 上,回收不到 2% 的堆.

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.

您可以尝试使用 -Xmx1g 增加堆的大小(将堆设置为 1 GB)

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

或者您可以使用命令行选项 -XX:-UseGCOverheadLimit 关闭此功能,这会隐藏症状,但不能解决问题.

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

此处详细介绍了此功能:http://www.oracle.com/technetwork/java/javase/gc-tuning-6-140523.html#par_gc.oom

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

这篇关于Xtext:这个异常是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-28 17:13