Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Sirius Resource Strategy and Resource.unload()
Sirius Resource Strategy and Resource.unload() [message #1744486] Tue, 27 September 2016 12:06 Go to next message
Felix Dorner is currently offline Felix DornerFriend
Messages: 392
Registered: December 2015
Senior Member
Hi,

I just got aware of http://cedric.brun.io/eclipse/eclipse-4.6.0M6/ where Cedric describes that you no longer call Resource.unload() when closing a session Surprised

Could you give me a reference to the bugzilla that introduced this new behavior?

Is this behavior somehow revertible/configurable to go back to the old behavior? Maybe by using the provided extension point?

I am in need of fixing https://bugs.polarsys.org/show_bug.cgi?id=1199 and I feel the pattern (clean references when elements are detected to be proxies) might be applied in quite a few places in the capella codebase, so the one fix for all would probably be to have sirius call Resource.close again. Is there a way I can force the old behavior at least temporarily until I analysed the codebase?

Thanks,
Felix
Re: Sirius Resource Strategy and Resource.unload() [message #1744493 is a reply to message #1744486] Tue, 27 September 2016 12:32 Go to previous messageGo to next message
Cedric Brun is currently offline Cedric BrunFriend
Messages: 431
Registered: July 2009
Senior Member
edit: same answer from Laurent right here

http://cedric.brun.io news and articles on eclipse and eclipse modeling.

[Updated on: Tue, 27 September 2016 12:38]

Report message to a moderator

Re: Sirius Resource Strategy and Resource.unload() [message #1744494 is a reply to message #1744486] Tue, 27 September 2016 12:37 Go to previous messageGo to next message
Laurent Fasani is currently offline Laurent FasaniFriend
Messages: 182
Registered: October 2014
Senior Member
Hi Felix,

clicking on the "way faster" in the blog post will bring you to https://bugs.eclipse.org/bugs/show_bug.cgi?id=442133 which is linked to the corresponding commit.

Indeed there is an extension point which can be used to override this (resourceStrategy in org.eclipse.sirius).

Just to add a bit more background regarding your last comment Resource.close() does not exists, users tend to think Resource.unload() clear the memory whereas it is not, it turns every object into a proxy (leading to a huge increase of memory usage) and is not clearing anything. "unload" will happens right before a "load" when a file change on the filesystem for instance. If you want to detect the session closing to, for instance, clear a empty a view or clear your own data then better use a SessionListener which will get notified when the session is CLOSING and CLOSED

If, finally, you decide to implement the org.eclipse.sirius.resourceStrategy extention point, you can use the DefaultResourceStrategyImpl class that do what was done before. Note that this extention point is internal as we would like to have some distance before set it as api.

Regards
Laurent


Laurent Fasani - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Sirius Resource Strategy and Resource.unload() [message #1744505 is a reply to message #1744494] Tue, 27 September 2016 14:01 Go to previous message
Felix Dorner is currently offline Felix DornerFriend
Messages: 392
Registered: December 2015
Senior Member
Oh, thank you I didn't see there was a link..

Quote:

Resource.close() does not exists,

Sorry, I meant unload().
Quote:

Users tend to think Resource.unload() clear the memory whereas it is not

The real reason here was to get a speedup, and I understand your idea behind it. However I prefer a slow application over a broken one. For such an impacting change like this I would rather like to opt in rather than having to opt out of it.

Anyway, now we've seen it so we can fix it.
Previous Topic:Show Nodes selectively from another Model
Next Topic:Cannot find the class file for org.eclipse.sirius.ui.business.api.dialect.DialectEditor
Goto Forum:
  


Current Time: Fri Apr 26 15:28:40 GMT 2024

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

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

Back to the top