Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Disposing of Resources and ResourceSet
Disposing of Resources and ResourceSet [message #483311] Tue, 01 September 2009 00:18 Go to next message
Alex Mising name is currently offline Alex Mising nameFriend
Messages: 51
Registered: August 2009
Member
Suppose one is done with processing of Resources in the ResourceSet; what has to be saved has been saved etc. Resources, ResourseSet and model object instances are not needed anymore. Is there / could there be any reason to do Resource.unload()? Resource.getContents().clean()? Or could these just be left to garbage collection?

This is mostly about avoiding extra processing done by unload() on large models, but any insight relevant to disposing of Resources/ResourceSets instances that are no longer needed is appreciated ...

Thank you,
Alex
Re: Disposing of Resources and ResourceSet [message #483361 is a reply to message #483311] Tue, 01 September 2009 10:52 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6690
Registered: July 2009
Senior Member
Alex,

Garbage collection should suffice if you wnt to get rid of *all*
resources and heir content.

Cheers
/Eike

----
http://thegordian.blogspot.com



Alex schrieb:
> Suppose one is done with processing of Resources in the ResourceSet;
> what has to be saved has been saved etc. Resources, ResourseSet and
> model object instances are not needed anymore. Is there / could there
> be any reason to do Resource.unload()? Resource.getContents().clean()?
> Or could these just be left to garbage collection?
>
> This is mostly about avoiding extra processing done by unload() on
> large models, but any insight relevant to disposing of
> Resources/ResourceSets instances that are no longer needed is
> appreciated ...
>
> Thank you,
> Alex


Re: Disposing of Resources and ResourceSet [message #483362 is a reply to message #483311] Tue, 01 September 2009 10:59 Go to previous message
Mario Winterer is currently offline Mario WintererFriend
Messages: 136
Registered: July 2009
Senior Member
Hi Alex!

As far as I know is no unload done by the generated editor, so it should
not be necessary if you do not intend to reuse the resource set. In case
you are using a shared editing domain (EMF Transaction API), it is
required as the life cycle of the editing domain exceeds that of your
resource(s).
Note that "unload()" also removes adapters from the model objects, so if
you have added adapters that exist longer than your model objects,
you should either remove them unload the resource to avoid memory leaks
(the adapter references the model via its target property).

Mario


Alex schrieb:
> Suppose one is done with processing of Resources in the ResourceSet;
> what has to be saved has been saved etc. Resources, ResourseSet and
> model object instances are not needed anymore. Is there / could there be
> any reason to do Resource.unload()? Resource.getContents().clean()? Or
> could these just be left to garbage collection?
>
> This is mostly about avoiding extra processing done by unload() on large
> models, but any insight relevant to disposing of Resources/ResourceSets
> instances that are no longer needed is appreciated ...
>
> Thank you,
> Alex
Previous Topic:[Announce] Eclipse Modeling Days
Next Topic:[CDO] Delete a resource
Goto Forum:
  


Current Time: Thu Sep 19 14:14:09 GMT 2024

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

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

Back to the top