Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 287451

Summary: Memory leak in WorkbenchPresentationFactory
Product: [RT] RAP Reporter: Loïc Bertholet <loic.bertholet>
Component: WorkbenchAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: philippe.nembrard
Version: 1.2   
Target Milestone: 1.3 M2   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Propersed fix none

Description Loïc Bertholet CLA 2009-08-24 11:12:25 EDT
Steps to reproduce:
* Open one and only one editor
* Close the editor
* 16 ko are not released

As there is no more opened editor, EditorSashConainer.removeEditor(EditorPane pane) remove the EditorStack called "workbook" and create another one.
This process includes calling WorkbenchPresentationFactory.createEditorPresentation(...) which add a SessionStoreListener in order to release some stuff when session will be invalidated.
Objects contained in this listener retain almost 16 ko.
The problem is that each time that the only opened editor is closed, 16 more ko are retained until session invalidation.

I have a patch which replaces the session store listener by a dispose listener on the TabbedStackPresentation control with widgetDisposed(...) executing the same code as beforeDestroy(...)

result.getControl().addDisposeListener(new DisposeListener() {

	public void widgetDisposed(DisposeEvent event) {
	     defaultMultiTabListener.attach(null, IWorkbenchPreferenceConstants.SHOW_MULTIPLE_EDITOR_TABS, true);
	}
});
Comment 1 Rüdiger Herrmann CLA 2009-09-16 07:19:52 EDT
Created attachment 147296 [details]
Propersed fix
Comment 2 Rüdiger Herrmann CLA 2009-09-16 07:20:53 EDT
Fixed in CVS HEAD