A way to reduce memory cost during create diagram [message #1779440] |
Sun, 07 January 2018 22:49  |
Eclipse User |
|
|
|
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 #1779529 is a reply to message #1779517] |
Tue, 09 January 2018 04:32  |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 1.64636 seconds