Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Xtext builder participant OutOfMemoryError
Xtext builder participant OutOfMemoryError [message #666015] Mon, 18 April 2011 16:00 Go to next message
Rafael Angarita is currently offline Rafael AngaritaFriend
Messages: 94
Registered: November 2010
Member
Hello everybody,

I'm still having memory problems when loading Xtext projects with many (about 15000) files. I made the optimizations mentioned in the Sebastian's blog and then the Xtext builer (alone) worked great.

Now, I have another Eclipse project where I have the rest of the code of my plugin and where I implemented the IXtextBuilderParticipant interface to be able to do the extra proccesing needed. I made a little example of my builder, the only thing that it does is to print every object and its referenced objects. Here is the code:

public class MyBuilderParticipant implements IXtextBuilderParticipant   {


	public static final String BUILDER_ID = "MyBuilderId";

	public static EList<Resource> resources;

	@Override
	public void build(IBuildContext context, IProgressMonitor monitor)
	throws CoreException {

			if (context.getBuildType().equals(BuildType.FULL)){
				//full building: round 1
				for (IResourceDescription.Delta delta : context.getDeltas()) {
					if (delta.getNew() != null){	
						URI uri = getObjectUrl(delta.getNew());
						if(uri != null){
							EObject eObject = context.getResourceSet().getEObject(uri, true);
							System.out.println(eObject);
						}
					}
				}
				//full building: round 2
				for (IResourceDescription.Delta delta : context.getDeltas()) {
					if (delta.getNew() != null){
						URI uri = getObjectUrl(delta.getNew());
						if(uri != null){
							EObject eObject = context.getResourceSet().getEObject(uri, true);
							updateReferences(eObject);
						}
					}
				}
			}
	}
	
	private void updateReferences(EObject data) {

		if (data instanceof Table){
			addTableReferences((Table) data);
		} else if (data instanceof Attribute){
			addAttributeReferences((Attribute)data);
		} else if (data instanceof Procedure){
			addProcedureReferences((Procedure)data);
		} else if (data instanceof Domain){
			addDomainReferences((Domain)data);	
		}
	}
	
	private void addDomainReferences(Domain domain) {
		System.out.println(domain.getName());
		System.out.println(domain.eResource().getURI().path());
	}
	
	private void addProcedureReferences(Procedure procedure) {
		System.out.println(procedure.getName());
		System.out.println(procedure.eResource().getURI().path());
	}

	private void addAttributeReferences(Attribute attribute) {
		//This is the exception line:
		//at altagracia.builder.XtextAltagraciaBuilderParticipant.addAttributeReferences
		//(XtextAltagraciaBuilderParticipant.java:97)
		Domain domain = attribute.getDomain();
		if (attribute != null && domain != null) {
			System.out.println(domain.getName());
			System.out.println(attribute.eResource().getURI().path());
		}
	}
	
	private void addTableReferences(Table table) {

		if (table != null) {
			System.out.println(table.getName());
			System.out.println(table.eResource().getURI().path());
			if (table.getTable() != null) {
				List<Column> Columns = table.getTable().getColumns();
				for(Column column: Columns) {
					if (column.getAttribute() != null) {
						System.out.println(column.getAttribute().getName());
					}
				}
			}
		}
	}

	private URI getObjectUrl(IResourceDescription file){

		Iterator<IEObjectDescription> it = file.getExportedObjects().iterator();
		if (it.hasNext()) {
			return it.next().getEObjectURI();
		}else{
			return null;
		}
	}
}


Also, I've been experimenting with the GC and memory parameters of the JVM too with no success. This is one of the setting I've tried:

-Xms2000m -Xmx2500m  -XX:NewSize=128m -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=85 -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSIncrementalDutyCycleMin=1  -XX:+CMSClassUnloadingEnabled


After awhile, my computers gets really slow and I get error:

java.lang.OutOfMemoryError: Java heap space
	at org.eclipse.swt.widgets.Widget.windowProc(Widget.java:1719)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:4796)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:4360)
	at org.eclipse.swt.internal.gtk.OS._gtk_main_do_event(Native Method)
	at org.eclipse.swt.internal.gtk.OS.gtk_main_do_event(OS.java:8168)
	at org.eclipse.swt.widgets.Display.eventProc(Display.java:1238)
	at org.eclipse.swt.internal.gtk.OS._g_main_context_iteration(Native Method)
	at org.eclipse.swt.internal.gtk.OS.g_main_context_iteration(OS.java:2229)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3159)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2640)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438)
	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:664)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:616)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1383)

!ENTRY org.eclipse.core.jobs 4 2 2011-04-18 11:00:14.248
!MESSAGE An internal error occurred during: "Building workspace".
!STACK 0
java.lang.OutOfMemoryError: Java heap space
	at java.util.LinkedHashMap.createEntry(LinkedHashMap.java:441)
	at java.util.LinkedHashMap.addEntry(LinkedHashMap.java:423)
	at java.util.HashMap.put(HashMap.java:402)
	at org.eclipse.xtext.resource.containers.StateBasedContainer.doGetUriToDescription(StateBasedContainer.java:59)
	at org.eclipse.xtext.resource.impl.ResourceDescriptionsBasedContainer.getUriToDescription(ResourceDescriptionsBasedContainer.java:48)
	at org.eclipse.xtext.resource.containers.StateBasedContainer.getResourceDescriptions(StateBasedContainer.java:50)
	at org.eclipse.xtext.resource.containers.FilterUriContainer.getResourceDescriptions(FilterUriContainer.java:31)
	at org.eclipse.xtext.scoping.impl.DefaultGlobalScopeProvider.createContainerScope(DefaultGlobalScopeProvider.java:99)
	at org.eclipse.xtext.scoping.impl.DefaultGlobalScopeProvider.createContainerScopeWithContext(DefaultGlobalScopeProvider.java:95)
	at org.eclipse.xtext.scoping.impl.DefaultGlobalScopeProvider.getScope(DefaultGlobalScopeProvider.java:51)
	at org.eclipse.xtext.scoping.impl.AbstractGlobalScopeDelegatingScopeProvider.getGlobalScope(AbstractGlobalScopeDelegatingScopeProvider.java:32)
	at org.eclipse.xtext.scoping.impl.ImportedNamespaceAwareLocalScopeProvider.getScope(ImportedNamespaceAwareLocalScopeProvider.java:136)
	at org.eclipse.xtext.scoping.impl.ImportedNamespaceAwareLocalScopeProvider.getScope(ImportedNamespaceAwareLocalScopeProvider.java:140)
	at org.eclipse.xtext.scoping.impl.AbstractDeclarativeScopeProvider.delegateGetScope(AbstractDeclarativeScopeProvider.java:72)
	at org.eclipse.xtext.scoping.impl.AbstractDeclarativeScopeProvider.getScope(AbstractDeclarativeScopeProvider.java:102)
	at org.eclipse.xtext.linking.impl.DefaultLinkingService.getScope(DefaultLinkingService.java:49)
	at org.eclipse.xtext.linking.impl.DefaultLinkingService.getLinkedObjects(DefaultLinkingService.java:103)
	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.builder.MyBuilderParticipant.addAttributeReferences(XtextAltagraciaBuilderParticipant.java:97)
	at altagracia.builder.MyBuilderParticipant.updateReferences(XtextAltagraciaBuilderParticipant.java:76)
	at altagracia.builder.MyBuilderParticipant.build(XtextAltagraciaBuilderParticipant.java:58)
	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)


I marked in my builder code the line that causes the error.

I am really stuck here. What could I do? The code of my builder is very simple and the Xtext builder alone works perfectly

Thank you very much for your help!!









Re: Xtext builder participant OutOfMemoryError [message #666092 is a reply to message #666015] Tue, 19 April 2011 06:15 Go to previous messageGo to next message
Alexander Nittka is currently offline Alexander NittkaFriend
Messages: 1193
Registered: July 2009
Senior Member
Hi,

did you apply all the optimisations mentioned in the blog. That is, did you make sure you only export those objects that really need to be visible to the outside world and did you adapt the fragment provider to make URIs of your objects (much) shorter?

Alex
Re: Xtext builder participant OutOfMemoryError [message #666119 is a reply to message #666015] Tue, 19 April 2011 08:07 Go to previous messageGo to next message
Jan Koehnlein is currently offline Jan KoehnleinFriend
Messages: 760
Registered: July 2009
Location: Hamburg
Senior Member
When you navigate the model, e.g. by calling Attribute.getDomain() as in
your stacktrace, you are resolving this reference, i.e. loading the
referenced resource into the resource set. It look like this way you are
pulling everything into memory even though the builder is just loading
clusters of initial resources. I suspect this is why you're running out
of memory.

Try to figure out if what you're trying to achieve can be done with
information from the index only (i.e. without resolving elements). If
there's just a bit of data missing, and you could try to add this as
userData to the IEObjectDescriptions when indexing.

BTW, in Xtext 2.0 we have significantly reduced memory consumption.
Maybe you could give it a try?

Am 18.04.11 18:00, schrieb Rafael Angarita:
> Hello everybody,
> I'm still having memory problems when loading Xtext projects with many
> (about 15000) files. I made the optimizations mentioned in the
> Sebastian's blog and then the Xtext builer (alone) worked great.
>
> Now, I have another Eclipse project where I have the rest of the code of
> my plugin and where I implemented the IXtextBuilderParticipant interface
> to be able to do the extra proccesing needed. I made a little example of
> my builder, the only thing that it does is to print every object and its
> referenced objects. Here is the code:
>
>
> public class MyBuilderParticipant implements IXtextBuilderParticipant {
>
>
> public static final String BUILDER_ID = "MyBuilderId";
>
> public static EList<Resource> resources;
>
> @Override
> public void build(IBuildContext context, IProgressMonitor monitor)
> throws CoreException {
>
> if (context.getBuildType().equals(BuildType.FULL)){
> //full building: round 1
> for (IResourceDescription.Delta delta : context.getDeltas()) {
> if (delta.getNew() != null){
> URI uri = getObjectUrl(delta.getNew());
> if(uri != null){
> EObject eObject = context.getResourceSet().getEObject(uri, true);
> System.out.println(eObject);
> }
> }
> }
> //full building: round 2
> for (IResourceDescription.Delta delta : context.getDeltas()) {
> if (delta.getNew() != null){
> URI uri = getObjectUrl(delta.getNew());
> if(uri != null){
> EObject eObject = context.getResourceSet().getEObject(uri, true);
> updateReferences(eObject);
> }
> }
> }
> }
> }
>
> private void updateReferences(EObject data) {
>
> if (data instanceof Table){
> addTableReferences((Table) data);
> } else if (data instanceof Attribute){
> addAttributeReferences((Attribute)data);
> } else if (data instanceof Procedure){
> addProcedureReferences((Procedure)data);
> } else if (data instanceof Domain){
> addDomainReferences((Domain)data);
> }
> }
>
> private void addDomainReferences(Domain domain) {
> System.out.println(domain.getName());
> System.out.println(domain.eResource().getURI().path());
> }
>
> private void addProcedureReferences(Procedure procedure) {
> System.out.println(procedure.getName());
> System.out.println(procedure.eResource().getURI().path());
> }
>
> private void addAttributeReferences(Attribute attribute) {
> //This is the exception line:
> //at
> altagracia.builder.XtextAltagraciaBuilderParticipant.addAttr ibuteReferences
> //(XtextAltagraciaBuilderParticipant.java:97)
> Domain domain = attribute.getDomain();
> if (attribute != null && domain != null) {
> System.out.println(domain.getName());
> System.out.println(attribute.eResource().getURI().path());
> }
> }
>
> private void addTableReferences(Table table) {
>
> if (table != null) {
> System.out.println(table.getName());
> System.out.println(table.eResource().getURI().path());
> if (table.getTable() != null) {
> List<Column> Columns = table.getTable().getColumns();
> for(Column column: Columns) {
> if (column.getAttribute() != null) {
> System.out.println(column.getAttribute().getName());
> }
> }
> }
> }
> }
>
> private URI getObjectUrl(IResourceDescription file){
>
> Iterator<IEObjectDescription> it = file.getExportedObjects().iterator();
> if (it.hasNext()) {
> return it.next().getEObjectURI();
> }else{
> return null;
> }
> }
> }
>
>
> Also, I've been experimenting with the GC and memory parameters of the
> JVM too with no success. This is one of the setting I've tried:
>
>
> -Xms2000m -Xmx2500m -XX:NewSize=128m -XX:+UseConcMarkSweepGC
> -XX:CMSInitiatingOccupancyFraction=85 -XX:+UseCMSInitiatingOccupancyOnly
> -XX:CMSIncrementalDutyCycleMin=1 -XX:+CMSClassUnloadingEnabled
>
>
> After awhile, my computers gets really slow and I get error:
>
>
> java.lang.OutOfMemoryError: Java heap space
> at org.eclipse.swt.widgets.Widget.windowProc(Widget.java:1719)
> at org.eclipse.swt.widgets.Control.windowProc(Control.java:4796 )
> at org.eclipse.swt.widgets.Display.windowProc(Display.java:4360 )
> at org.eclipse.swt.internal.gtk.OS._gtk_main_do_event(Native Method)
> at org.eclipse.swt.internal.gtk.OS.gtk_main_do_event(OS.java:81 68)
> at org.eclipse.swt.widgets.Display.eventProc(Display.java:1238)
> at org.eclipse.swt.internal.gtk.OS._g_main_context_iteration(Na tive Method)
> at org.eclipse.swt.internal.gtk.OS.g_main_context_iteration(OS. java:2229)
> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3159)
> at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2640)
> at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604)
> at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:24 38)
> at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671)
> at
> org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:332)
>
> at
> org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:664)
> at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
> at
> org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplication.java:115)
>
> at
> org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:196)
>
> at
> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:110)
>
> at
> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:79)
>
> at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:369)
>
> at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
>
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:57)
>
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:43)
>
> at java.lang.reflect.Method.invoke(Method.java:616)
> at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 619)
> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
> at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
> at org.eclipse.equinox.launcher.Main.main(Main.java:1383)
>
> !ENTRY org.eclipse.core.jobs 4 2 2011-04-18 11:00:14.248
> !MESSAGE An internal error occurred during: "Building workspace".
> !STACK 0
> java.lang.OutOfMemoryError: Java heap space
> at java.util.LinkedHashMap.createEntry(LinkedHashMap.java:441)
> at java.util.LinkedHashMap.addEntry(LinkedHashMap.java:423)
> at java.util.HashMap.put(HashMap.java:402)
> at
> org.eclipse.xtext.resource.containers.StateBasedContainer.do GetUriToDescription(StateBasedContainer.java:59)
>
> at
> org.eclipse.xtext.resource.impl.ResourceDescriptionsBasedCon tainer.getUriToDescription(ResourceDescriptionsBasedContaine r.java:48)
>
> at
> org.eclipse.xtext.resource.containers.StateBasedContainer.ge tResourceDescriptions(StateBasedContainer.java:50)
>
> at
> org.eclipse.xtext.resource.containers.FilterUriContainer.get ResourceDescriptions(FilterUriContainer.java:31)
>
> at
> org.eclipse.xtext.scoping.impl.DefaultGlobalScopeProvider.cr eateContainerScope(DefaultGlobalScopeProvider.java:99)
>
> at
> org.eclipse.xtext.scoping.impl.DefaultGlobalScopeProvider.cr eateContainerScopeWithContext(DefaultGlobalScopeProvider.jav a:95)
>
> at
> org.eclipse.xtext.scoping.impl.DefaultGlobalScopeProvider.ge tScope(DefaultGlobalScopeProvider.java:51)
>
> at
> org.eclipse.xtext.scoping.impl.AbstractGlobalScopeDelegating ScopeProvider.getGlobalScope(AbstractGlobalScopeDelegatingSc opeProvider.java:32)
>
> at
> org.eclipse.xtext.scoping.impl.ImportedNamespaceAwareLocalSc opeProvider.getScope(ImportedNamespaceAwareLocalScopeProvide r.java:136)
>
> at
> org.eclipse.xtext.scoping.impl.ImportedNamespaceAwareLocalSc opeProvider.getScope(ImportedNamespaceAwareLocalScopeProvide r.java:140)
>
> at
> org.eclipse.xtext.scoping.impl.AbstractDeclarativeScopeProvi der.delegateGetScope(AbstractDeclarativeScopeProvider.java:7 2)
>
> at
> org.eclipse.xtext.scoping.impl.AbstractDeclarativeScopeProvi der.getScope(AbstractDeclarativeScopeProvider.java:102)
>
> at
> org.eclipse.xtext.linking.impl.DefaultLinkingService.getScop e(DefaultLinkingService.java:49)
>
> at
> org.eclipse.xtext.linking.impl.DefaultLinkingService.getLink edObjects(DefaultLinkingService.java:103)
>
> 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.builder.MyBuilderParticipant.addAttributeReferenc es(XtextAltagraciaBuilderParticipant.java:97)
>
> at
> altagracia.builder.MyBuilderParticipant.updateReferences(Xte xtAltagraciaBuilderParticipant.java:76)
>
> at
> altagracia.builder.MyBuilderParticipant.build(XtextAltagraci aBuilderParticipant.java:58)
>
> 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)
>
>
> I marked in my builder code the line that causes the error.
>
> I am really stuck here. What could I do? The code of my builder is very
> simple and the Xtext builder alone works perfectly
>
> 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
Re: Xtext builder participant OutOfMemoryError [message #666247 is a reply to message #666015] Tue, 19 April 2011 15:06 Go to previous messageGo to next message
Rafael Angarita is currently offline Rafael AngaritaFriend
Messages: 94
Registered: November 2010
Member
I think I implemented the optimizations. Before that, I couldn't even run the Xtext builder alone.

At this point, I only need to get the name of the referenced object (attribute.getDomain().getName()). If this can be done with
information from the index only, I think it will be fine.

Surely I will give Xtext 2.0 a try.Smile
Re: Xtext builder participant OutOfMemoryError [message #666355 is a reply to message #666247] Wed, 20 April 2011 06:09 Go to previous messageGo to next message
Alexander Nittka is currently offline Alexander NittkaFriend
Messages: 1193
Registered: July 2009
Senior Member
Hi,

the resource description contains a list of exported objects (IEObjectDescription) as well as a list of the references of the model (IReferenceDescription). The latter contains both URIs of the source and the target of the reference.

So you should be able iterate over the the references in the index, search the index for the source object (description) check its type and then search for the target object (description) and extract its name... without instantiating any model objects.

Alex
Re: Xtext builder participant OutOfMemoryError [message #666944 is a reply to message #666015] Sun, 24 April 2011 22:22 Go to previous message
Rafael Angarita is currently offline Rafael AngaritaFriend
Messages: 94
Registered: November 2010
Member
Thank you very much guys!

The index contains all the information I need for the builder. Now it works really fast and without memory problems. Now, I have to see how to do the code generation without running out of memory.

Thank you!

Previous Topic:Xtend2 issues
Next Topic:A Design input request regarding external links
Goto Forum:
  


Current Time: Sat Apr 27 01:51:31 GMT 2024

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

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

Back to the top