Community
Participate
Working Groups
In Sirius, we recently have fixed Bug 431634, a memory leak: each opened editor was retained in a wrongly disposed action contributed to our diagram editor internal tool bar. During validation of our fix, a Yourkit snapshot taken during a junit test suite showed that 2109 ToolbarContributionRecord are still retained in the ToolbarManagerRenderer. Our toolbar is mainly populated through contribution factories (See Bug 410426) and the extension point org.eclipse.ui.menus.ExtensionContributionFactory. The Sirius diagram editor creates the toolbar and its manager, then it asks the menu service of the editor site to populate the toolbar with contributions (IMenuService.populateContributionManager). In debug, we discovered that org.eclipse.e4.ui.workbench.renderers.swt.ToolBarManagerRenderer.cleanUp(MToolBar) does not clean the records corresponding to our toolbar: the dispose listener is added only to the toolbar created by the ToolBarManagerRenderer. I think this dispose listener should be added on all toolbar: maybe in processContributions ? (which can be called from the workbench menu service)
See https://git.eclipse.org/r/24304 for potential fix. On Sirius, each diagram editor open/close add around 50 retained ToolbarContributionRecord. With the proposed fix, the cleanup is well done.
Released as http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=f01438295d4a1650a36d4c0605cd3523a7f80136 with minor changes. Thanks Maxime. PW
There's a bug in this code, as we add the tag and it is saved to the workbench.xmi. That means it will never get re-added on new sessions. PW
M7 ends today, do I have to pull this fix? PW
Oh, had a quick idea to put it in transient data. Fixed with http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=6f5c8886d7c14b787e344df4ced9ab31a82252f2 PW
I confirmed this in 4.4.0.I20140428-2000. Maxime, could you also confirm this is working in your scenarios? PW
.
(In reply to Paul Webster from comment #6) > I confirmed this in 4.4.0.I20140428-2000. > > Maxime, could you also confirm this is working in your scenarios? Hi Paul. Maxime is not available this week. I'll try to have a look, but I did not follow the details of this issue, and I'm not sure I'll have the time to dig into it. I know Maxime considered the two related issues in Sirius as resolved (bug #428322 and bug #431634) and I believe he checked against platform I-builds with the fix included. If you don't hear from us, consider it's OK on our side.
Hi Paul, I confirm this is working with our scenarios. I have checked with a fresh Sirius M7 RC1 build and Luna M7 (Build id: I20140501-0200). Regards, Maxime
Thanks PW