List of features currently provided by my additions to MAT:
- Find all instances of Frames/Dialogs
- Find possible leaking Frames/Dialogs
- Extract Components of Container
- Show Additional Information for Components / Frames
Find all instances of Frames/Dialogs
In a Swing Application Frames / Dialogs get opened and closed.
To find all of those in the Heap you can look for them but you also have to know which Subclasses there are…
This Query will find them all and show an outgoing listing.
Find possible leaking Frames/Dialogs
Normally you use a DefaultCloseOperation on a Frame or Dialog.
And you would call dispose on them if needed. But i often found: this did not always happen. So Frames and specifically Dialogs were still kept in the Heap and were hold by native resources. Finding them was digging through the heap and did cost time. So with this Query Frames / Dialogs that are not visible but have a open native peer (probably not called dispose on them) will be listed.
Extract Components of Container
Not knowing where a Frame has come from the easiest way sometimes to find the source to identify it was looking at the components it was made of.
But clicking through a deep hierarchy of components takes time and a lot of clicks.
So these two contextmenuqueries can extract the direct subcomponents (e.g. root pane of the frame) or all subcomponents in the hierarchy and list them. With this it gives the ability to easier identify where the frame could be created/used.
Show Additional Information for Components / Frames
As you may have already noticed, NameResolvers have been added to provide better information for instances of Swing in MAT.
In this example you can see that title / visible / name or if a Dialog is modal are directly presented on the instances. Looking up this often required information in mostly over 100 fields takes time. Now you can find it directly.