Skip to main content



      Home
Home » Eclipse Projects » Sirius » Duplication memory in Sirius, GMF or EMF?
Duplication memory in Sirius, GMF or EMF? [message #1775006] Mon, 23 October 2017 08:42 Go to next message
Eclipse UserFriend
HI,

I found a interesting phenomenon, if i create a Sirius diagram for a big size model (100,000), the biggest memory consumer is object array (java.long.object[]), it occupied over 80% memory.

And I found many of the object array stores NodeImpl instances, but the size of these array is reduced one by one (Show in the pictures). This cause the memory grows in speed of O(n²) by model size. I think this may be a memory leak or bad strategy in somewhere.
  • Attachment: 1.png
    (Size: 130.55KB, Downloaded 158 times)
  • Attachment: 2.png
    (Size: 114.15KB, Downloaded 129 times)
  • Attachment: 0.png
    (Size: 103.60KB, Downloaded 129 times)

[Updated on: Mon, 23 October 2017 08:46] by Moderator

Re: Duplication memory in Sirius, GMF or EMF? [message #1775052 is a reply to message #1775006] Tue, 24 October 2017 04:45 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

Thank you for your analyse.

If I understand correctly these arrays are referenced by feature changes that are not meant to be persistent but more punctual.
So these should be garbageable at some point.
I imagine it grows only from a short time when node are loaded maybe or in another situation.

Regards,

Pierre

[Updated on: Tue, 24 October 2017 05:10] by Moderator

Re: Duplication memory in Sirius, GMF or EMF? [message #1775057 is a reply to message #1775052] Tue, 24 October 2017 05:09 Go to previous messageGo to next message
Eclipse UserFriend
What is your analysis context?
100,000 is the number of semantic elements or do you have diagrams with 100,000 graphical element?
When do take the snapshot for analysing? After opening a diagram, the project?
Re: Duplication memory in Sirius, GMF or EMF? [message #1775063 is a reply to message #1775057] Tue, 24 October 2017 05:28 Go to previous messageGo to next message
Eclipse UserFriend
Hi, Pierre Guilet

Thanks for your reply!

100,000 is the number of graphical elements in the Sirius diagram.
After i created the diagram and opened it, i did several times GC, then take the "Heap dump" operation. I analyse the heapdump file. So, maybe other Objects reference to "FeatureChangeImpl" instance indirectly, then bring this problem.
Re: Duplication memory in Sirius, GMF or EMF? [message #1775090 is a reply to message #1775063] Tue, 24 October 2017 09:27 Go to previous messageGo to next message
Eclipse UserFriend
Ok feature changes are kept for undo/redo purpose so they can be present in memory for some time until it is cleared either by crossing a limit or a save I guess.

It works with an old/new value mechanic. So if you add a node in a list, your change will have as old value the old list and as new value a new list containing the new node.
The difference must be kept to be able to reverse the change.
So I don't think we can do much about it.

However GMF deals not really well with this kind of graphical element number for one diagram. If you could split this number with more representations you would have more efficiency.
This would be a huge challenge to handle such number of elements.
Re: Duplication memory in Sirius, GMF or EMF? [message #1775293 is a reply to message #1775090] Fri, 27 October 2017 05:48 Go to previous messageGo to next message
Eclipse UserFriend
Hi, Pierre Guilet

After i created a Sirius diagram and opened it, I checked the undolist in DefaultOperationHistory, found it only contains two EMFCommandOperations. One of the EMFCommandOperations which contains CreateRepresentatinCommand, that contains many FeatureChangeImpl instances.

I think the CreateRepresentatinCommand and RefreshRepresentatinCommand should not support the undo function, i override the canUndo() function in these two command, but it didn't work.

Another thing, while executing CreateRepresentatinCommand, it will create many NodeImpl instances. Each creation of NodeImpl instance will create a new transaction and the transaction will produce the ChangeDescription (I do not very clear about this process).
I guess if the creation of NodeImpl do not use transaction, maybe the memory problem will be resolved.
Re: Duplication memory in Sirius, GMF or EMF? [message #1775467 is a reply to message #1775293] Mon, 30 October 2017 10:30 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

In Sirius the representation creation is done with the following code in org.eclipse.sirius.ui.business.api.editor.SpecificEditorInputTranformer.createDRepresentation(EObject, String):
  CreateRepresentationCommand command = new CreateRepresentationCommand(session, descriptionToUse, semanticModel, name, new NullProgressMonitor());
            session.getTransactionalEditingDomain().getCommandStack().execute(command);

If you really want to try something, you can provide your own editing domain by using the org.eclipse.sirius.common.editingDomainFactory extension point. This editing domain of yours will provide your own command stack that will not keep commands with feature changes you don't want.
This could work if I am not missing something big.

Regards,

Pierre
Re: Duplication memory in Sirius, GMF or EMF? [message #1775569 is a reply to message #1775467] Wed, 01 November 2017 08:28 Go to previous messageGo to next message
Eclipse UserFriend
Thank you, Pierre!

I will consider your suggestion to implement my own editing domain, i hope it will not be too difficulty.
Re: Duplication memory in Sirius, GMF or EMF? [message #1779441 is a reply to message #1775569] Sun, 07 January 2018 22:55 Go to previous message
Eclipse UserFriend
See also: https://www.eclipse.org/forums/index.php/m/1779440/
Previous Topic:Sirius + EEF - the simplest way to customize property behaviour
Next Topic:Can Sirius work with the new version of GEF
Goto Forum:
  


Current Time: Wed Jul 23 15:56:17 EDT 2025

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

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

Back to the top