This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 431740 - [Workbench] How is it my workbench.xmi is 783kB and growing?
Summary: [Workbench] How is it my workbench.xmi is 783kB and growing?
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.4   Edit
Hardware: PC Windows 8
: P3 normal (vote)
Target Milestone: 4.4 RC1   Edit
Assignee: Paul Webster CLA
QA Contact: Paul Webster CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-01 14:34 EDT by Timo Kinnunen CLA
Modified: 2014-05-26 14:40 EDT (History)
3 users (show)

See Also:
emoffatt: review+


Attachments
It's way too big (52.62 KB, application/x-zip-compressed)
2014-04-01 14:34 EDT, Timo Kinnunen CLA
no flags Details
After opening a new window and closing the previous one, the file size of workbench.xmi is now 319kB. (38.63 KB, application/octet-stream)
2014-04-02 17:43 EDT, Timo Kinnunen CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Timo Kinnunen CLA 2014-04-01 14:34:03 EDT
Created attachment 241486 [details]
It's way too big

I've just noticed that my workbench.xmi files have gotten huge. This workbench.xmi is 783kB and it resides in an Eclipse installation version:

Eclipse SDK
Version: Luna (4.4)
Build id: I20140325-0830

It's predecessor, still in use, is also a whopping 760kB large, it's being used in an Eclipse installation version: 

Eclipse SDK
Version: Luna (4.4)
Build id: I20140123-1600

The previous version has huge problems with Compare view and EGit, trying to close such a view pretty much always causes errors about duplicate handlers and leaves the workbench in unstable condition. This would be my guess as to how things have gotten to this point. This seems to have gotten better, thankfully.

But the bloat remains. Is there anything that can be done to clean this up?
Comment 1 Timo Kinnunen CLA 2014-04-02 17:43:02 EDT
Created attachment 241530 [details]
After opening a new window and closing the previous one, the file size of workbench.xmi is now 319kB.
Comment 2 Wojciech Sudol CLA 2014-05-12 07:47:51 EDT
Every restart of clean Eclipse (no extra plugins, no projects, Welcome page closed) duplicates the following DirectToolItems:
debug
org.eclipse.debug.internal.ui.actions.DebugDropDownAction
org.eclipse.debug.internal.ui.actions.RunDropDownAction
org.eclipse.ui.externaltools.ExternalToolMenuDelegateToolbar
JavaWizards
org.eclipse.jdt.ui.actions.OpenProjectWizard
org.eclipse.jdt.ui.actions.OpenPackageWizard
org.eclipse.jdt.ui.actions.NewTypeDropDown
Search        
openType
org.eclipse.search.OpenSearchDialogPage
Comment 3 Wojciech Sudol CLA 2014-05-12 08:13:59 EDT
It seems that children of action set toolbars are being duplicated. The tool items mentioned in the previous comment come from the following toolbars:
org.eclipse.search.searchActionSet
org.eclipse.jdt.ui.JavaElementCreationActionSet
org.eclipse.debug.ui.launchActionSet
Comment 4 Wojciech Sudol CLA 2014-05-12 08:48:07 EDT
The problem is that WorkbenchWindow.updateActionBars() (called in WorkbenchWindow.setup()) recreates toolbar items ignoring the fact the items are already in model (restored earlier from worbench.e4xmi).
Now I am working on the fix.
Comment 5 Paul Webster CLA 2014-05-12 09:03:04 EDT
Traditionally on shutdown we tend to clear out menus and toolbars.  Are these not included in that clean up?

PW
Comment 6 Wojciech Sudol CLA 2014-05-14 07:47:54 EDT
The bug has been introduced in M4 with the fix for bug 416746.
Comment 7 Wojciech Sudol CLA 2014-05-14 09:38:59 EDT
Reverting the commit not only reintroduces the bug 416746, but also causes a problem with Quick Access positioning.
Comment 8 Paul Webster CLA 2014-05-14 09:48:54 EDT
I'll have a patch in a minute for a dispose when closing a WorkbenchWindow.  That's probably the best place to remove the model elements.

Any idea why moving a call to set TBR to false would leak tool item model elements?

PW
Comment 9 Paul Webster CLA 2014-05-14 10:08:17 EDT
Opaque tool items are a runtime artifact.  Remove them from the model on workbench window dispose:

https://git.eclipse.org/r/26523

PW
Comment 10 Paul Webster CLA 2014-05-14 10:08:56 EDT
Wojtek, Eric, could you please review the fix?

PW
Comment 11 Eric Moffatt CLA 2014-05-14 13:06:05 EDT
Committed:

http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=d0348d7fd188979e9f54aad0253dd9f799717792

At some point we may want to check all the trim rather than just the top but for now this is fine...
Comment 12 Paul Webster CLA 2014-05-26 14:40:18 EDT
In 4.4.0.I20140522-1330

PW