Bug 581653 - [ServiceRegistry] Memory leak due to IServiceRegistryIndexer
Summary: [ServiceRegistry] Memory leak due to IServiceRegistryIndexer
Status: ASSIGNED
Alias: None
Product: Papyrus
Classification: Modeling
Component: Core (show other bugs)
Version: 6.4.0   Edit
Hardware: PC Windows 10
: P3 major (vote)
Target Milestone: 6.4.0   Edit
Assignee: Vincent Lorenzo CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 581660
Blocks: 562218
  Show dependency tree
 
Reported: 2023-03-10 08:46 EST by Vincent Lorenzo CLA
Modified: 2023-03-20 06:51 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vincent Lorenzo CLA 2023-03-10 08:46:03 EST
The new service IServiceRegistryIndexer stores the couple ServiceRegistry/CoreMultiDiagramEditor and ServiceRegistry/ResourceSet in a map. 
These couples are never removed from the map when the editor is closed and it generates memory leaks in Papyrus.
Comment 1 Vincent Lorenzo CLA 2023-03-10 09:22:55 EST
Reproductible launching Junit tests of org.eclipse.papyrus.uml.diagram.clazz.tests and analysing the runtime with Graal VisualVM
Comment 2 Vincent Lorenzo CLA 2023-03-13 06:11:50 EDT
read PapyrusMultiDiagramEditor instead of CoreMultiDiagramEditor in the previous comment

After running UML Class Junit tests, with VisualVM before the patch we get : 
*85 instances of PapyrusMultiDiagramDiagramEditor
*15 instances of UMLClassDiagramForMultiEditor

After the patch, we get :
*1 instance of PapyrusMultiDiagramDiagramEditor
*(still 15 instances of UMLClassDiagramForMultiEditor)

many others editor elements are still in memory after the tests, we will open others bugs for them