Community
Participate
Working Groups
Created attachment 133810 [details] proposed patch This patch updates the inspector so you can easily tell if an object is an SWT widget and whether or not the object has been disposed. I've found this useful when tracking down memory leaks related to leaking listeners and widget references.
Created attachment 133811 [details] swt image
Created attachment 133812 [details] swt disposed image
+1 for this feature
Cool feature. Looking at the code: why don't you call Widget#isDisposed() for the check?
(In reply to comment #4) > Looking at the code: why don't you call Widget#isDisposed() for the check? Well the heap is always post-mortem - one cannot call methods on the objects because the objects do not live anymore. We'll take a look at this feature for the next service release. I did not submit the patch, because the only the image in the object inspector is changed, not in the object lists itself. I thought it might be confusing if different icons are used for one and the same object.
Ok, I understand. I was asking because I didn't find the code where the display instance is set to null in the Widget.java implementation of RAP. But as Benny is already on CC list, I don't worry about this anymore :-)
Another way of doing this would be to have an extension point which returned an icon for an object, rather like a name resolver. This could then be added to Icons.forObject and ideally Icons for object would do the adding of GC roots and inbound/outbound decorators.
This issue has been migrated to https://github.com/eclipse-mat/org.eclipse.mat/issues/3.