RFR(xs): 8203455: jcmd: VM.metaspace: print loader name for anonymous CLDs.

Thomas Stüfe thomas.stuefe at gmail.com
Sun May 20 06:49:57 UTC 2018

Hi all,

may I please have reviews for this small addition.

Bug: https://bugs.openjdk.java.net/browse/JDK-8203455
Webrev: http://cr.openjdk.java.net/~stuefe/webrevs/8203455-VM.metaspace-display-loader-name-for-anonymous-cld/webrev.00/webrev/

VM.metaspace show-loaders can be used to display loaders (well, really
CLD instances).

For anonymous CLDs, only "anonymous" is shown. It would be helpful to
show to which loader these CLD are assigned.


 "272: ClassLoaderData 0x00007f5ba0538f10 for anonymous class"


After patch:

 "268: CLD 0x00007ff0c45738f0 for <anonymous class>, loaded by app,
instance of jdk.internal.loader.ClassLoaders$AppClassLoader"


Notes: this patch has a bit more lines than I liked because I did not
find a singly utility function in ClassloaderData which fit my
purpose. I wanted to see name and class of the associated loader for
both normal and unloading case. ClassloaderData::loader_name() has a
number of shortcomings, I opened
https://bugs.openjdk.java.net/browse/JDK-8203456 as a follow up rfe.

Thank you,


More information about the hotspot-runtime-dev mailing list