Community
Participate
Working Groups
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.
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.
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
Created attachment 21150 [details] Patch to DecorationScheduler
Fixed in build >20050516
This looks prone to a race condition since there's no synchronization across the update check and the addition of the listener.
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.
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.
Ok good idea. I'll reopen and address that.
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.
This is not being removed in 20050526
This is actually fixed. The reference left over it in NavigatorFrameSource
Marking verified