Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not unload EMF resources when disposing an editing context #4137

Open
pcdavid opened this issue Oct 25, 2024 · 0 comments · May be fixed by #4138
Open

Do not unload EMF resources when disposing an editing context #4137

pcdavid opened this issue Oct 25, 2024 · 0 comments · May be fixed by #4138

Comments

@pcdavid
Copy link
Member

pcdavid commented Oct 25, 2024

Currently the default implementation of IEMFEditingContext.dispose() does:

this.getDomain().getResourceSet().getResources().forEach(Resource::unload);

This is costly both in CPU and RAM for no benefit: it will iterate on the content of all resources, compute the proxy URI for every element (which can allocate a lot of long strings and use lots of memory), and then... nothing. Nothing/nobody will ever use the ResourceSet in question after that.
Unloading is only useful to force all elements to become proxies so they are properly re-resolved afterwards, but in our case its all for nothing.

On my machine, this explicit unload takes about 820ms, compared to the ~2200ms needed to load the resource set.
It's not blocking anyone as this is only done once nobody is connected to the editing context, but it's still burning CPU and increasing memory pressure for no benefit.

pcdavid added a commit that referenced this issue Oct 25, 2024
@pcdavid pcdavid linked a pull request Oct 25, 2024 that will close this issue
39 tasks
@pcdavid pcdavid added this to the 2025.1.0 milestone Oct 28, 2024
@sbegaudeau sbegaudeau removed this from the 2025.1.0 milestone Dec 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants