|Memory leak in Ecore application [message #1816893]
||Mon, 11 November 2019 09:29
| Iñaki Berriotxoa
Registered: February 2019
I am having a memory issue with my RCP application and I am not able to locate it.
Let's see. I have an RCP application where users model the structure of an Application. Later on, based on the user input, the I generate some other intermediate models to finally generate code.
Before I start the transformation process I create a ResourceSet and I load all the required models in there.
ResourceSet resourceSet = new ResourceSetImpl();
File definitionFile = new File(filePath);
Resource resource = resourceSet.getResource(URI.createFileURI(definitionFile.getAbsolutePath()), true);
Definition definition = (SwDefinition) resource.getContents().get(0);
During the transformation process, I create some objects to manage this transformation. This objects are the responsibles to create the intermediate ecore resources that will allow to finally generate code.
I have been analyzing with MAT and JavaVisualVM, and this is the conclusion. When the transformation process is finished, the manager objects I create for transformation are deleted, but it looks like the ecore resources I create during this process are not deleted from heap (even if I call the GarbageCollector after the transformation) , and somehow something is pointing to these objects. I am not able to locate what is pointing to this resources.
What am I doing wrong?
Does anybody have a clue about what could be happening?
Can somebody explain how ecore saves the resources in memory?
Thanks in advance
Powered by FUDForum
. Page generated in 0.06579 seconds