Community
Participate
Working Groups
For each inspect popup numerous objects are leaked. It appears the root of the leaks is the failure to dispose/uninstall the InformationPresenter. When I add this though I get: java.lang.NullPointerException at org.eclipse.debug.internal.ui.LazyModelPresentation.removeListener (LazyModelPresentation.java:162) at org.eclipse.debug.internal.ui.DelegatingModelPresentation.removeListener (DelegatingModelPresentation.java:243) at org.eclipse.jface.viewers.ContentViewer.handleDispose (ContentViewer.java:152) ...
So with the uninstall, the LazyModelPresentation is disposed via the ExpressionInfoControl dispose (via the new uninstall code). But then when the VariablesViewer is disposed (when the popup is closed), a listener is attempted to be removed from the LazyModelPresentation but the listener collection has already been nulled out --> NPE
Instead of calling dispose() on the Information Control, we should be calling uninstall on the Information Presenter (which will call dispose for us). Fixed in PopupInformationControl, PopupDisplayAction, and PopupInspectAction.
Darins, please verify
Things are better but still for each inspect we are leaking 1 AbstractInformationControlManager$1 and 1 InformationPresenter and the reference appears to be from the instance variable fInformationPresenter of the PopupInspectAction. Sorry I have run out of time to look into this tonight but I thought I would put these findings out there for you.
Actually it could be that the listener (AbstractInformationControlManager$1) is still not getting removed as an event listener (added on line 430 of AbstractInformationControlManager.install)
Hoping to move the debug popups to generic framework provided by UI team. See Bug #72374
Adding my name to the cc list as we are now tracking performance issues more closely. Please remove the performance keyword if this is not a performance bug.
Have the remaining leaks been fixed?
The remaining leak is in AbstractInformationControlManager's install(). A dispose listener is added to the control and is not removed by uninstall() or dispose(). Moving to TEXT for comment.
Can you clarify? The listener is added to the Widget. The widget nulls out the eventTable upon dispose. Do you have dump from a profiler that shows the allocation path?
We install the InformationPresenter on a TextViewer when the user executes the popup Inspect action. When the popup is dismissed, the listener is not removed because the TextViewer's Widget is not disposed. Closing the viewer probably does clean up anything left over. See DarinS' comment #4 for details of what is being leaked. Sorry, no dump from a profiler. Waiting for a new license still.
Reopening for investigation.
I've added code to remove the listener and profiled it with I20050426-1700 plus my fix and could no longer detect leaks by using Run > Inspect (Ctrl+Shift+I). Please note that creating (and afterwards disposing) the information control manager for every single popup isn't efficient. The idea is to install it once on the subject control. Please consider fixing this on your part.
This bug should be marked as fixed, as the leak is fixed. A new bug should be opened for the issue of re-creating the popup on each inpsect.
Marking as fixed.