Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 327433

Summary: Display class loaders as tree in class loader explorer
Product: [Tools] MAT Reporter: Andrew Johnson <andrew_johnson>
Component: GUIAssignee: Project Inbox <mat.gui-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P3    
Version: 1.1   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Andrew Johnson CLA 2010-10-11 06:47:22 EDT
The class loader explorer displays the parents of class loaders.

Sometimes it is useful to display the class loaders as a tree, so expanding a loader gives the children.
Comment 1 Andrew Johnson CLA 2010-10-11 06:49:37 EDT
I have some code to enhance the class loader explorer with a -tree option to display the loaders as a tree. I have also made the explorer examine a set of loaders if required rather than all of them, by specifying the loaders or classes loaded by the loaders or instances of classes loaded by loaders.
Comment 2 Andrew Johnson CLA 2011-01-11 00:53:31 EST
The enhancement has been made.
Here is an example of the output:

Class Name                                                                                                          | Defined Classes | No. of Instances
---------------------------------------------------------------------------------------------------------------------------------------------------------
                                                                                                                    |                 |                 
com.ibm.oti.vm.BootstrapClassLoader @ 0x480ee0                                                                      |          15,597 |          117,703
sun.misc.Launcher$ExtClassLoader @ 0x483bb8                                                                         |             217 |              143
|- parent sun.misc.Launcher$AppClassLoader @ 0x48b200                                                               |           3,885 |            1,870
|  |- parent org.mortbay.start.Classpath$Loader @ 0x4eb458                                                          |             837 |              115
|  |  |- parent Cometd Test WebApp                                                                                  |             482 |              125
|  |  |- parent Test WebApp                                                                                         |              82 |                8
|  |  |- parent Test WebApp                                                                                         |              82 |                8
|  |  |- parent /leak                                                                                               |               6 |                3
|  |  |  |- demo.LeakServlet                                                                                        |                 |                1
|  |  |  |- demo.LeakServlet.doGet(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V|                 |                1
|  |  |  |- demo.LeakServlet.getOtherChars()[C                                                                      |                 |                1
|  |  |  |- demo.LeakServlet.<clinit>()V                                                                            |                 |                0
|  |  |  |- demo.LeakServlet.<init>()V                                                                              |                 |                0
|  |  |  |- demo.LeakServlet.getChars()[C                                                                           |                 |                0
|  |  |  '- Total: 6 entries                                                                                        |                 |                 
|  |  |- parent JAAS Test                                                                                           |               0 |                0