Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 12:30 Go to next message
kimi raikonnan is currently offline kimi raikonnanFriend
Messages: 145
Registered: June 2015
Senior Member
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 12:31 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
can you give more context of how you are using xtext please

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
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 13:03 Go to previous messageGo to next message
kimi raikonnan is currently offline kimi raikonnanFriend
Messages: 145
Registered: June 2015
Senior Member
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 13:24 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
are you talking about the editor? the xtext build? a web app? .....

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: After parsing files using xtext, Should we keep xtext emf model in the memory? [message #1727672 is a reply to message #1727617] Fri, 25 March 2016 00:28 Go to previous messageGo to next message
kimi raikonnan is currently offline kimi raikonnanFriend
Messages: 145
Registered: June 2015
Senior Member
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 08:11 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
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


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
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 10:18 Go to previous message
Jan Koehnlein is currently offline Jan KoehnleinFriend
Messages: 760
Registered: July 2009
Location: Hamburg
Senior Member
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?


---
Get professional support from the Xtext committers at www.typefox.io
Previous Topic:UML2 - text editor
Next Topic:Parse error - keyword used as parameter value
Goto Forum:
  


Current Time: Wed Apr 24 16:39:54 GMT 2024

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

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

Back to the top