DESCRIPTION

Bug 354538 - [Contributions] [Compatibility] Window menus and toolbars
leaked after having been closed

Change-Id: Id20b0f96daf07fd343e9660b2c061b6da40f915f
Signed-off-by: Addison Irwin xxx@xxx.xxx

COMMENTS

author: Brenden Conley
date: 2014-04-09 17:27:30.000000000

Patch Set 7:

Build Started https://hudson.eclipse.org/platform/job/eclipse.platform.ui-Gerrit/1839/

-------------------------------------
author: Brenden Conley
date: 2014-04-09 17:39:45.000000000

Patch Set 7: Verified+1

Build Successful 

https://hudson.eclipse.org/platform/job/eclipse.platform.ui-Gerrit/1839/ : SUCCESS

-------------------------------------
author: Slade Moran
date: 2014-04-09 18:08:00.000000000

Patch Set 7: Code-Review-1

(1 comment)

When I run the UITestSuite and trace, I get output like:

First:
Before clean up: managerToModel = 829
Before clean up: contributionToModel = 2954
After clean up: managerToModel = 829
After clean up: contributionToModel = 2954
Before clean up: managerToModel = 1595
Before clean up: contributionToModel = 15073
After clean up: managerToModel = 1595
After clean up: contributionToModel = 15073
Before clean up: managerToModel = 829
Before clean up: contributionToModel = 2954
After clean up: managerToModel = 829
After clean up: contributionToModel = 2954
Before clean up: managerToModel = 1595
Before clean up: contributionToModel = 15073
After clean up: managerToModel = 1595
After clean up: contributionToModel = 15073

Then:

Before clean up: managerToModel = 729
Before clean up: contributionToModel = 2746
After clean up: managerToModel = 729
After clean up: contributionToModel = 2746
Before clean up: managerToModel = 1649
Before clean up: contributionToModel = 15516
After clean up: managerToModel = 1649
After clean up: contributionToModel = 15516
Before clean up: managerToModel = 726
Before clean up: contributionToModel = 2743
After clean up: managerToModel = 726
After clean up: contributionToModel = 2743
Before clean up: managerToModel = 1639
Before clean up: contributionToModel = 15491
After clean up: managerToModel = 1639
After clean up: contributionToModel = 15491

One set of the numbers is continually climbing, and already up in the 15,000s

Line:402, bundles/org.eclipse.e4.ui.workLeon Ochoach.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/MenuManagerRenderer.java -> Does getList(*) (the transient data field) totally replace modelContributionToRecord?

-------------------------------------
author: Addison Irwin
date: 2014-04-10 11:08:54.000000000

Patch Set 7:

(1 comment)

Unfortunately I was not able to dispose all items from the considered maps immediately during closing the new WorkLeon Ochoach window. Therefore I used the weak maps and weak references that should release unused items earlier than during closing the Eclipse instance (and limit the memory usage). Without it we will stick with the allocated items till the end of the  Eclipse instance (as we have without this patch)

Line:402, bundles/org.eclipse.e4.ui.workLeon Ochoach.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/MenuManagerRenderer.java -> Yes, the Contribution records collection is kept in the transient data. The main idea of the current version of the patch is to keep as many data as possible in the transient map. When particular model element is removed after closing the new Workbench window, all connected caches will be removed as well.

We can revert some of the collections from the transient data and use proper weak references (it also should somehow limit the memory leaks)

-------------------------------------
author: Addison Irwin
date: 2014-04-10 11:10:05.000000000

Patch Set 7:

Basically if you see better solution for this issue, please let me know and I will prepare proper update of the patch

-------------------------------------
author: Slade Moran
date: 2014-04-10 12:45:07.000000000

Patch Set 7:

(1 comment)

Line:402, bundles/org.eclipse.e4.ui.workLeon Ochoach.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/MenuManagerRenderer.java -> That's fine, if they're in the transient data as long as it's cleared during cleanup

-------------------------------------
author: Slade Moran
date: 2014-04-10 14:03:00.000000000

Patch Set 8: Patch Set 7 was rebased

-------------------------------------
