Duplication memory in Sirius, GMF or EMF? [message #1775006] |
Mon, 23 October 2017 08:42  |
Eclipse User |
|
|
|
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 #1775293 is a reply to message #1775090] |
Fri, 27 October 2017 05:48   |
Eclipse User |
|
|
|
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   |
Eclipse User |
|
|
|
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
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04207 seconds