Bug 545824 - [Memory Leak] Closing (hiding) a MCompositePart does not remove its inner parts from the PartActivationHistory
Summary: [Memory Leak] Closing (hiding) a MCompositePart does not remove its inner par...
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.6   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-03-27 04:32 EDT by Ghaith Hachem CLA
Modified: 2019-12-06 08:33 EST (History)
1 user (show)

See Also:


Attachments
Project showing various cases where the MPart does not get disposed (18.02 KB, application/x-zip-compressed)
2019-03-27 10:23 EDT, Ghaith Hachem CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ghaith Hachem CLA 2019-03-27 04:32:03 EDT
When closing a composite part (For example a split editor) the inner parts will not removed. Upon profiling, I found that one of the places where the Inner parts remain are in the PartActivationHistory which does not take into account removing inner composite parts.
Since these parts are not removed, their transient data is also not cleared, for example in the case of a split editor, the EditorReference will not be removed. In the case of custom editors, it means the transient data will now effectively live for the entire session.
Comment 1 Andrey Loskutov CLA 2019-03-27 04:43:30 EDT
I guess this is not a regression in 4.11.
Could you please provide a Gerrit patch and/or attach small project to reproduce?
Comment 2 Ghaith Hachem CLA 2019-03-27 10:23:36 EDT
Created attachment 278037 [details]
Project showing various cases where the MPart does not get disposed

I created a project with the intention to demonstrate the specific PartActivationHistory leak, however it looks to me like every View is currently not being correctly disposed.
The project now shows all the cases I found : 
- Workbench page does not correctly dispose an E4 view reference
- Compatibility view parts don't get disposed (Even with the RemoveOnHide tag)
- Part activation History does not forget inner parts.

The 3 cases are available as menu entries in the LeakDemo menu, the second case (Compatiblity view) is commented out in favour of a variation that does not leak (Editor) to show that other similar cases actually get disposed correctly.

I can probably submit a fix for the PartActivationHistory issue this week, but I'm not sure I have the time to address the rest of the issues, or if it actually is valid to not dispose the part in some cases.
Comment 3 Ghaith Hachem CLA 2019-03-27 10:27:11 EDT
This issue goes back to at least Oxygen.3 (That was my target platform initially but I tested this also on 2019.3 and the issues are still there)
Comment 4 Andrey Loskutov CLA 2019-12-06 08:33:19 EST
(In reply to Ghaith Hachem from comment #2)
> I can probably submit a fix for the PartActivationHistory issue this week,
> but I'm not sure I have the time to address the rest of the issues, or if it
> actually is valid to not dispose the part in some cases.

Sorry for late follow up, could you just push the fix your mention on Gerrit, and we can discuss if it is worth or not to merge it?