Memory disposal during unload() [message #1855896] |
Wed, 09 November 2022 02:08  |
Eclipse User |
|
|
|
It seems that the default implementation of Resource does not free up any memory when it is unloaded(). I wonder if this method is the correct injection point for such controls. I have looked at the EMF book, articles and code but found no definitive answer. Maybe I am misreading the intent of unload all together, and it is only to remove the costly notifiers, rather than the data held by the object itself.
Can anybody point me in the right direction, please?
|
|
|
|
|
Re: Memory disposal during unload() [message #1855900 is a reply to message #1855898] |
Wed, 09 November 2022 04:23   |
Eclipse User |
|
|
|
Thank you for your response and sorry for being vague. I am quite familiar with garbage collection and the various classes of weak references available. I was expecting that unload would possibly drop (set null) all the attribute information of an EObject, as this can be reconstructed by loading from the stream, as identifiers should be stable. Depending on the size of these, this could be a relevant savings. Then there would be various degrees of trimming the structure, by tree depth, by use frequency of features, etc.
At the heart of it is that I am simply trying to understand when and why you would unload a resource, other then to disable the notifiers. With the default implementation, as you have stated, unloading uses more memory, not less, as the contents structures use regular references and hence will prevent garbage collection. Even if a client does not hold a reference to any EObject in a reference, the memory is still held, even after an unload.
Or am I missing anything in the memory management here?
[Updated on: Wed, 09 November 2022 04:24] by Moderator
|
|
|
|
|
|
|
Re: Memory disposal during unload() [message #1855926 is a reply to message #1855912] |
Thu, 10 November 2022 00:31  |
Eclipse User |
|
|
|
Hi Ed,
Thanks for having a look. I guess as I stated in earlier discussion, I can run MWE2 from ant, but not the other way around. Note that I am quite aware of it and its role. My working history includes being in charge of the model-driven bus for a large German automotive. And that involved MWE2 and its use. You may find some posts regarding its limitations in automated use if you dig through the history around 2013. I would nod to "far from perfect" as an assessment at least at that point in time. In fact, its usage was so poor that we went around it and wrote things in gradle to achieve reasonable behaviour. W.r.t. EMF not progressing beyond toy applications I guess I am saying that its industry relevance is quite limited and that, in large part, is due to Eclipse's intractability. This extends to EMF transitively. If I propose to use Eclipse as a basis for our work, I do that so we benefit from EMF's positive properties in the Eclipse component context. My developers would much rather I ditch it today and use Epsilon and Gradle only. The thinking I receive in mde net is much the same. So either the joint investment of EMF so far is made to pay, or we can throw it in and rewrite in TypeScript. Which is, by the way, seriously suggested. Use mine (i.e. xText) is not enough. I am very happy for the frame EMF has provided. It and you must be credited for removing the clunk of MOF out of the equation and so it and you succeeded, where JMI failed. Now my view would be to make sure that it becomes an industry engineering solution, rather than a click-click IDE tool or an academic pass time that will be ignored in the trenches. And for that I need reuse, and for that, at this stage, I will accept ant.
Best wishes,
JG
[Updated on: Thu, 10 November 2022 00:34] by Moderator
|
|
|
Powered by
FUDForum. Page generated in 0.06847 seconds