OutOfMemoryError: Java heap space [message #663361] |
Mon, 04 April 2011 19:10 |
Rafael Angarita Messages: 94 Registered: November 2010 |
Member |
|
|
Hello guys,
I'm still struggling with the problem of how to handle very large projects. Right now, my test project has almost 15000 files. Fortunately, this is the bigger of the project I will have to import using my DSL.
At first, I couldn't run my xtext project alone with all the files. After enabling the clustering Xtext Builder that Sebastian explains here, everything worked great.
Now, I'm trying to do the full build enabling my implementation of IXtextBuilderParticipant, which is in another plugin.
The first round of the build goes ok, but in the second round I start getting the references, and eclipse and my machine start to slow down, until I get:
java.lang.OutOfMemoryError: Java heap space
at java.lang.String.toLowerCase(String.java:2485)
at java.lang.String.toLowerCase(String.java:2508)
at org.eclipse.xtext.resource.impl.EObjectDescriptionLookUp.getExportedObjects(EObjectDescriptionLookUp.java:42)
at org.eclipse.xtext.resource.impl.AbstractResourceDescription.getExportedObjects(AbstractResourceDescription.java:27)
at org.eclipse.xtext.resource.impl.AbstractContainer$2.apply(AbstractContainer.java:41)
at org.eclipse.xtext.resource.impl.AbstractContainer$2.apply(AbstractContainer.java:1)
at com.google.common.collect.Iterators$10.next(Iterators.java:662)
at com.google.common.collect.Iterators$10.next(Iterators.java:661)
at com.google.common.collect.Iterators$6.hasNext(Iterators.java:477)
at org.eclipse.xtext.scoping.impl.ContainerBasedScope.getContentByName(ContainerBasedScope.java:46)
at org.eclipse.xtext.linking.impl.ImportedNamesAdapter$WrappingScope.getContentByName(ImportedNamesAdapter.java:52)
at org.eclipse.xtext.linking.impl.DefaultLinkingService.getLinkedObjects(DefaultLinkingService.java:106)
at org.eclipse.xtext.linking.lazy.LazyLinkingResource.getEObject(LazyLinkingResource.java:94)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getEObject(ResourceSetImpl.java:219)
at org.eclipse.emf.ecore.util.EcoreUtil.resolve(EcoreUtil.java:202)
at org.eclipse.emf.ecore.util.EcoreUtil.resolve(EcoreUtil.java:262)
at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eResolveProxy(BasicEObjectImpl.java:1483)
at org.xtext.altagracia.attribute.impl.AttributeImpl.getDomain(AttributeImpl.java:258)
at altagracia.plugin.wizards.Connect.addAttributeReferences(Connect.java:130)
at altagracia.plugin.wizards.Connect.addAttributeReferences(Connect.java:122)
at altagracia.plugin.wizards.Connect.updateReferences(Connect.java:69)
at altagracia.plugin.wizards.Connect.fileReference(Connect.java:364)
at altagracia.builder.xTextAltagraciaBuilderLogic.SecondFullBuildFile(xTextAltagraciaBuilderLogic.java:100)
at altagracia.builder.XtextAltagraciaBuilderParticipant.build(XtextAltagraciaBuilderParticipant.java:111)
at org.eclipse.xtext.builder.impl.RegistryBuilderParticipant.build(RegistryBuilderParticipant.java:60)
at org.eclipse.xtext.builder.impl.XtextBuilder.doBuild(XtextBuilder.java:157)
at org.eclipse.xtext.builder.impl.XtextBuilder.fullBuild(XtextBuilder.java:180)
at org.eclipse.xtext.builder.impl.XtextBuilder.build(XtextBuilder.java:78)
at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:629)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:172)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:203)
This line:
at altagracia.plugin.wizards.Connect.addAttributeReferences(Connect.java:130)
is:
Attribute and Domain are two of my garmmars, and a Attribute can cross-reference a Domain.
I don't know if there is something wrong with my IXtextBuilderParticipant or there is something else going on. I know it can be difficult for you guys to know what's happening here. I'm looking for maybe an advise of how to handle this big projects, a suggestion. If you want to look deeper, I don't have any problem if you want me to share my code with you.
Thank you very much!
|
|
|
Re: OutOfMemoryError: Java heap space [message #663371 is a reply to message #663361] |
Mon, 04 April 2011 19:26 |
Sebastian Zarnekow Messages: 3118 Registered: July 2009 |
Senior Member |
|
|
Hi Rafael,
you'll have to make sure that you do not load the whole world into one
single resource set with your builder participant, e.g. by applying
clustering strategies there, too.
Regards,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com
Am 04.04.11 21:10, schrieb Rafael Angarita:
> Hello guys,
> I'm still struggling with the problem of how to handle very large
> projects. Right now, my test project has almost 15000 files.
> Fortunately, this is the bigger of the project I will have to import
> using my DSL.
>
> At first, I couldn't run my xtext project alone with all the files.
> After enabling the clustering Xtext Builder that Sebastian explains
> here, everything worked great.
>
> Now, I'm trying to do the full build enabling my implementation of
> IXtextBuilderParticipant, which is in another plugin.
>
> The first round of the build goes ok, but in the second round I start
> getting the references, and eclipse and my machine start to slow down,
> until I get:
>
>
> java.lang.OutOfMemoryError: Java heap space
> at java.lang.String.toLowerCase(String.java:2485)
> at java.lang.String.toLowerCase(String.java:2508)
> at
> org.eclipse.xtext.resource.impl.EObjectDescriptionLookUp.get ExportedObjects(EObjectDescriptionLookUp.java:42)
>
> at
> org.eclipse.xtext.resource.impl.AbstractResourceDescription. getExportedObjects(AbstractResourceDescription.java:27)
>
> at
> org.eclipse.xtext.resource.impl.AbstractContainer$2.apply(Ab stractContainer.java:41)
>
> at
> org.eclipse.xtext.resource.impl.AbstractContainer$2.apply(Ab stractContainer.java:1)
>
> at com.google.common.collect.Iterators$10.next(Iterators.java:6 62)
> at com.google.common.collect.Iterators$10.next(Iterators.java:6 61)
> at com.google.common.collect.Iterators$6.hasNext(Iterators.java :477)
> at
> org.eclipse.xtext.scoping.impl.ContainerBasedScope.getConten tByName(ContainerBasedScope.java:46)
>
> at
> org.eclipse.xtext.linking.impl.ImportedNamesAdapter$Wrapping Scope.getContentByName(ImportedNamesAdapter.java:52)
>
> at
> org.eclipse.xtext.linking.impl.DefaultLinkingService.getLink edObjects(DefaultLinkingService.java:106)
>
> at
> org.eclipse.xtext.linking.lazy.LazyLinkingResource.getEObjec t(LazyLinkingResource.java:94)
>
> at
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getEObje ct(ResourceSetImpl.java:219)
>
> at org.eclipse.emf.ecore.util.EcoreUtil.resolve(EcoreUtil.java: 202)
> at org.eclipse.emf.ecore.util.EcoreUtil.resolve(EcoreUtil.java: 262)
> at
> org.eclipse.emf.ecore.impl.BasicEObjectImpl.eResolveProxy(Ba sicEObjectImpl.java:1483)
>
> at
> org.xtext.altagracia.attribute.impl.AttributeImpl.getDomain( AttributeImpl.java:258)
>
> at
> altagracia.plugin.wizards.Connect.addAttributeReferences(Con nect.java:130)
> at
> altagracia.plugin.wizards.Connect.addAttributeReferences(Con nect.java:122)
> at altagracia.plugin.wizards.Connect.updateReferences(Connect.j ava:69)
> at altagracia.plugin.wizards.Connect.fileReference(Connect.java :364)
> at
> altagracia.builder.xTextAltagraciaBuilderLogic.SecondFullBui ldFile(xTextAltagraciaBuilderLogic.java:100)
>
> at
> altagracia.builder.XtextAltagraciaBuilderParticipant.build(X textAltagraciaBuilderParticipant.java:111)
>
> at
> org.eclipse.xtext.builder.impl.RegistryBuilderParticipant.bu ild(RegistryBuilderParticipant.java:60)
>
> at
> org.eclipse.xtext.builder.impl.XtextBuilder.doBuild(XtextBui lder.java:157)
> at
> org.eclipse.xtext.builder.impl.XtextBuilder.fullBuild(XtextB uilder.java:180)
>
> at org.eclipse.xtext.builder.impl.XtextBuilder.build(XtextBuild er.java:78)
> at
> org.eclipse.core.internal.events.BuildManager$2.run(BuildMan ager.java:629)
> at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
> at
> org.eclipse.core.internal.events.BuildManager.basicBuild(Bui ldManager.java:172)
>
> at
> org.eclipse.core.internal.events.BuildManager.basicBuild(Bui ldManager.java:203)
>
>
>
>
> This line:
>
>
> at
> altagracia.plugin.wizards.Connect.addAttributeReferences(Con nect.java:130)
>
>
> is:
>
>
> attribute.getDomain()
>
>
> Attribute and Domain are two of my garmmars, and a Attribute can
> cross-reference a Domain.
>
> I don't know if there is something wrong with my
> IXtextBuilderParticipant or there is something else going on. I know it
> can be difficult for you guys to know what's happening here. I'm looking
> for maybe an advise of how to handle this big projects, a suggestion. If
> you want to look deeper, I don't have any problem if you want me to
> share my code with you.
>
> Thank you very much!
>
>
>
>
>
>
|
|
|
|
|
|
Re: OutOfMemoryError: Java heap space [message #663709 is a reply to message #663528] |
Wed, 06 April 2011 09:23 |
Jan Koehnlein Messages: 760 Registered: July 2009 Location: Hamburg |
Senior Member |
|
|
Rafael,
to decide yourself what is indexed you must implement and bind an
IResourceDescription.Manager.
Regards
Jan
Am 05.04.11 15:57, schrieb Rafael Angarita:
> Hi,
> I have this grammar:
>
>
> TableDefinition:
> table=Table;
>
> Table:
> 'Name:' name=ID
> 'Columns:' '{' columns+=Column (',' columns+=Column)* '}'
> 'Indexes:' '{' indexes+=Index+ '}'
> ;
>
> Column:
> attribute=[attributeAG::Attribute] ;
>
> Index: {Index}
> 'Index:' name=IndexName
> 'Columns:' '{' indexcolumns+=IndexColumn (','
> indexcolumns+=IndexColumn)* '}'
> ;
>
> IndexName:
> ID
> ;
>
> IndexColumn:
> indexColumn=[Column]
> ;
>
>
>
> As you see, I have to give a QN to a Column of the Table to make them
> referencable inside its current Table as an Index. I don't want to make
> those coulmns visible from outside.
> I have hundreds of tables, which one with more than 10 attributes
> (columns) and I guess those more than 10 attributes per table are being
> exported to the global scope generating a heavy memory consumption I do
> not need. Am I right?
>
>
> If I am right I would like to not export them to the global scope, but I
> haven't figure it out yet. I have been looking here:
> http://www.eclipse.org/Xtext/documentation/1_0_0/xtext.html# resourcedescriptions
> but it's not clear to me how should I implement it.
>
> I thought I should override a method like bindIResourceDescription in my
> TableRuntimeModel to register my implementation class, but I think I was
> wrong.
>
> How should I do this?
>
> Thank you very much for your help!
>
>
>
>
>
>
>
>
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com
---
Get professional support from the Xtext committers at www.typefox.io
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03541 seconds