Skip to main content



      Home
Home » Modeling » TMF (Xtext) » After parsing files using xtext, Should we keep xtext emf model in the memory?(After parsing files using xtext, Should we keep xtext emf model in the memory?)
After parsing files using xtext, Should we keep xtext emf model in the memory? [message #1727608] Thu, 24 March 2016 08:30 Go to next message
Eclipse UserFriend
After parsing files using xtext, Should we keep xtext emf model of each file in the memory ?

Should we do anything to allow garbage collector to start working on them and free the memory?

What is the best practice to remove the model or to keep them in the memory?

Thanks
Re: After parsing files using xtext, Should we keep xtext emf model in the memory? [message #1727609 is a reply to message #1727608] Thu, 24 March 2016 08:31 Go to previous messageGo to next message
Eclipse UserFriend
can you give more context of how you are using xtext please
Re: After parsing files using xtext, Should we keep xtext emf model in the memory? [message #1727614 is a reply to message #1727609] Thu, 24 March 2016 09:03 Go to previous messageGo to next message
Eclipse UserFriend
Here you are what I mean, Is Xtext try to remove the emf of the files from the memory after parsing linking them? or it keep them in the memory?
My problem is by adding large number of files i found that the process consume large amount of available memory, thats why i am asking to know if its the normal behavior or i did something wrong i need to solve
Re: After parsing files using xtext, Should we keep xtext emf model in the memory? [message #1727617 is a reply to message #1727614] Thu, 24 March 2016 09:24 Go to previous messageGo to next message
Eclipse UserFriend
are you talking about the editor? the xtext build? a web app? .....
Re: After parsing files using xtext, Should we keep xtext emf model in the memory? [message #1727672 is a reply to message #1727617] Thu, 24 March 2016 20:28 Go to previous messageGo to next message
Eclipse UserFriend
I am talking about xtext build and editor.
I mean after opening a project contains 100 file as an example, they will be parsed and emf model will be generated to each one of them.
Does xtext keep these models in the memory?
Does it free them?
Re: After parsing files using xtext, Should we keep xtext emf model in the memory? [message #1727683 is a reply to message #1727672] Fri, 25 March 2016 04:11 Go to previous messageGo to next message
Eclipse UserFriend
you should do no have to do anything manually. xtext keeps the resources for open editors loaded (and maybe transitive needed) but that should not be a problem if your resources are not too interconnected.

during build all is loaded to the same resourceset. so if you have problems maybe using DynamicResourceClusteringPolicy as IResourceClusteringPolicy (bound via a own guice module via org.eclipse.xtext.ui.shared.overridingGuiceModule extension point)
https://www.eclipse.org/forums/index.php?t=msg&th=1069579&goto=1705987&#msg_1705987

besides this i can only give the advice to measure what actually happens. maybe working on scoping/validation could reduce the memory needed for open editors
Re: After parsing files using xtext, Should we keep xtext emf model in the memory? [message #1727690 is a reply to message #1727683] Fri, 25 March 2016 06:18 Go to previous message
Eclipse UserFriend
Xtext keeps only the models in memory that are currently used (during build, in open editors). Unneeded models are expunged and the memory is given free. Xtext uses an index to store information on models that may be interesting to the outside.
Are you experiencing memory leaks?
Previous Topic:UML2 - text editor
Next Topic:Parse error - keyword used as parameter value
Goto Forum:
  


Current Time: Sat Nov 08 07:55:57 EST 2025

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

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

Back to the top