Skip to main content



      Home
Home » Eclipse Projects » Sirius » A way to reduce memory cost during create diagram
A way to reduce memory cost during create diagram [message #1779440] Sun, 07 January 2018 22:49 Go to next message
Eclipse UserFriend
Hi,

As mentioned in another topic, https://www.eclipse.org/forums/index.php/m/1775006/ , i was found memory grows in speed of O(n²) by model size. Now i have a way to fix it.

In function DiagramDialectServices.createRepresentation(),
before canonicalSynchronizer.synchronize(), we can remove the TransactionChangeRecorder from gmfDiag.eAdapters(). After canonicalSynchronizer.synchronize(), we add the TransactionChangeRecorder back.

The TransactionChangeRecorder is used for undo/redo, during create representation, each creation of a nodeImpl will trigger TransactionChangeRecorder to create a FeatureChangImpl for recording the value before create this nodeImpl, so the memory grows in O(n²).

As my test, the memory sharply reduced while the model size is huge. But i don't know whether the modification brings other potential issues.

In my opinion, the representation creation can not be undo is acceptable.
Re: A way to reduce memory cost during create diagram [message #1779454 is a reply to message #1779440] Mon, 08 January 2018 05:02 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

I think the solution you propose can have impacts because some notifications will not be forwarded, the change recorder will not be added to new objects, etc...
Make undoable the representation creation is not trivial and must be studied.

Some improvement thought could be to not add one by one the nodes in the same list but instead to make an add all operation when creating the representation. So instead of having n² you will have n that is already much better. One feature change for all additions.

You can make a Sirius ticket to improve memory performance from representation creation. But it will not be a priority since other users does not have a memory problem. Your use case is kinda extreme.

Generally speaking Sirius is used with many representations to show your data so it can be readable from a human perspective. You tend to avoid having all your model elements on the same representation. I don't know why you need to show so much elements on a diagram. It seems to me that it would be not efficient for a human to exploit such diagram.

Regards,

Pierre

Re: A way to reduce memory cost during create diagram [message #1779517 is a reply to message #1779454] Mon, 08 January 2018 22:10 Go to previous messageGo to next message
Eclipse UserFriend
Hi, Pierre Guilet

Thanks for your reply. I agree with your improvement thought of "make an add all operation", it is the best way, but it is a little difficult for me now.

I debugged my modification, found the change recorder is added to the the new objects, because i add the change recorder back to the DiagramImpl(type of gmfDiagram) after canonicalSynchronizer.synchronize(), and it will add to the children of the DiagramImpl automatically.
Re: A way to reduce memory cost during create diagram [message #1779529 is a reply to message #1779517] Tue, 09 January 2018 04:32 Go to previous message
Eclipse UserFriend
Ok in a pure Sirius context in your specific case it may or may not work. I don't have the answer. If you really need these feature either you can do a Sirius ticket but I can't tell you if it will be treated and when. Or it will be up to you to use your solution and check you are breaking nothing :)

Regards,

Pierre
Previous Topic:Trouble With Element Based Edges
Next Topic:Dumb Question - What does "ai" stand for in ".aird"?
Goto Forum:
  


Current Time: Sat Jul 12 23:10:02 EDT 2025

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

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

Back to the top