Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 94547 - [Decorators] [Navigator] (leak) Dangling references to ResourceNavigator
Summary: [Decorators] [Navigator] (leak) Dangling references to ResourceNavigator
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P2 normal (vote)
Target Milestone: 3.1 RC1   Edit
Assignee: Tod Creasey CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-05-10 17:44 EDT by Stefan Xenos CLA
Modified: 2005-05-27 10:26 EDT (History)
2 users (show)

See Also:


Attachments
Patch to DecorationScheduler (908 bytes, patch)
2005-05-13 16:53 EDT, Tod Creasey CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Xenos CLA 2005-05-10 17:44:43 EDT
To reproduce:

Run Eclipse with a memory profiler
Close all perspectives but the resource perspective
Close the resource navigator
Force a GC

Notice that there are still references to the navigator through the decorator
manager.
Comment 1 Nick Edgar CLA 2005-05-10 19:03:15 EDT
During view disposal, the label provider changed listener is being removed from
the decorating label provider.
As part of this, it gets added to the removedListeners list in
DecorationScheduler, but the update job is not kicked so it just sits there.
Comment 2 Nick Edgar CLA 2005-05-10 19:05:53 EDT
Stack is:

Thread [main] (Suspended)
	DecorationScheduler.listenerRemoved(ILabelProviderListener) line: 613
	DecoratorManager.removeListener(ILabelProviderListener) line: 211
	DecoratingLabelProvider.removeListener(ILabelProviderListener) line: 152
	TreeViewer(ContentViewer).handleDispose(DisposeEvent) line: 152
	ContentViewer$2.widgetDisposed(DisposeEvent) line: 188
	TypedListener.handleEvent(Event) line: 100
	EventTable.sendEvent(Event) line: 82
	Tree(Widget).sendEvent(Event) line: 842
	Tree(Widget).sendEvent(int, Event, boolean) line: 866
	Tree(Widget).sendEvent(int) line: 847
	Tree(Widget).releaseWidget() line: 754
	Tree(Control).releaseWidget() line: 1575
	Tree(Scrollable).releaseWidget() line: 195
	Tree(Composite).releaseWidget() line: 594
	Tree.releaseWidget() line: 1484
	Tree(Widget).releaseResources() line: 719
	Composite.releaseChildren() line: 588
	Composite.releaseWidget() line: 593
	Composite(Widget).releaseResources() line: 719
	Composite.releaseChildren() line: 588
	Composite.releaseWidget() line: 593
	Composite(Widget).dispose() line: 380
	ViewPane(PartPane).dispose() line: 164
	ViewPane.dispose() line: 176
	ViewReference(WorkbenchPartReference).dispose() line: 613
	ViewFactory.releaseView(IViewReference) line: 238
	Perspective.hideView(IViewReference) line: 527
	WorkbenchPage.hideView(IViewReference) line: 1918
	ViewPane.doHide() line: 198
	ViewStack(PartStack).close(IPresentablePart) line: 459
	ViewStack(PartStack).close(IPresentablePart[]) line: 442
	PartStack$1.close(IPresentablePart[]) line: 98
	TabbedStackPresentation$1.handleEvent(TabFolderEvent) line: 81
	DefaultTabFolder(AbstractTabFolder).fireEvent(TabFolderEvent) line: 267
	DefaultTabFolder(AbstractTabFolder).fireEvent(int, AbstractTabItem) line: 276
	DefaultTabFolder.access$1(DefaultTabFolder, int, AbstractTabItem) line: 1
	DefaultTabFolder$1.closeButtonPressed(CTabItem) line: 63
	PaneFolder.notifyCloseListeners(CTabItem) line: 563
	PaneFolder$3.close(CTabFolderEvent) line: 190
	CTabFolder.onMouse(Event) line: 2073
	CTabFolder$1.handleEvent(Event) line: 291
	EventTable.sendEvent(Event) line: 82
	CTabFolder(Widget).sendEvent(Event) line: 842
	Display.runDeferredEvents() line: 2901
	Display.readAndDispatch() line: 2534
	Workbench.runEventLoop(Window$IExceptionHandler, Display) line: 1601
	Workbench.runUI() line: 1565
	Workbench.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 315
	PlatformUI.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 143
	IDEApplication.run(Object) line: 103
	PlatformActivator$1.run(Object) line: 230
	EclipseStarter.run(Object) line: 345
	EclipseStarter.run(String[], Runnable) line: 158
	NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available
[native method]
	NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39
	DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25
	Method.invoke(Object, Object[]) line: 324
	Main.invokeFramework(String[], URL[]) line: 328
	Main.basicRun(String[]) line: 272
	Main.run(String[]) line: 974
	Main.main(String[]) line: 950
Comment 3 Tod Creasey CLA 2005-05-13 16:53:22 EDT
Created attachment 21150 [details]
Patch to DecorationScheduler
Comment 4 Tod Creasey CLA 2005-05-16 09:35:46 EDT
Fixed in build >20050516
Comment 5 Nick Edgar CLA 2005-05-16 10:49:23 EDT
This looks prone to a race condition since there's no synchronization across the
update check and the addition of the listener.
Comment 6 Tod Creasey CLA 2005-05-16 11:04:35 EDT
This is actually only on the removal case and it is thrown out when the updates
are done. As soon as the update job is scheduled this will start storing the
deletions and they will all be cleared out when it is done.
Comment 7 Nick Edgar CLA 2005-05-16 11:15:49 EDT
What I mean is that if the job(s) complete immediately after updatesPending() is
called, but before adding the listener to the list, then you'll have the same
problem of the listener hanging around.  Looks like you need to synchronize
access to removedListeners here and in the jobs.
Comment 8 Tod Creasey CLA 2005-05-16 11:40:39 EDT
Ok good idea. I'll reopen and address that.
Comment 9 Tod Creasey CLA 2005-05-16 13:15:34 EDT
After consulation with John we decided the safest way to do this was to do a
second check to see if there was a race condition rather than introducing a lock
to the code.
Comment 10 Tod Creasey CLA 2005-05-27 08:00:55 EDT
This is not being removed in 20050526
Comment 11 Tod Creasey CLA 2005-05-27 10:25:51 EDT
This is actually fixed. The reference left over it in NavigatorFrameSource
Comment 12 Tod Creasey CLA 2005-05-27 10:26:37 EDT
Marking verified