RFR(xs): 8203455: jcmd: VM.metaspace: print loader name for anonymous CLDs.
David Holmes
david.holmes at oracle.com
Mon May 21 06:50:18 UTC 2018
On 21/05/2018 4:46 PM, Thomas Stüfe wrote:
> Hi David,
>
> On Mon, May 21, 2018 at 4:23 AM, David Holmes <david.holmes at oracle.com> wrote:
>> Hi Thomas,
>>
>> There's been a bit of discussion lately about how to "describe"
>> classloaders:
>>
>> https://bugs.openjdk.java.net/browse/JDK-8202605
>>
>> I'd rather not see another chunk of code added that 8202605 will have to fix
>> up. Can you live with the less-than-ideal output of the existing function,
>> under the expectation it will be updated to do a better job in the future?
>>
>
> 8206205 does not alleviate the need for this change, since currently
> we do not print any loader information for anonymous classes.
Sorry I was unclear. I meant for this patch to just add e.g. use of
loader_name(), even if not ideal, and allow 8202605 to clean up the
actual text later.
David
> Originally I planned to fix up this patch with a follow up patch later
> once those utility functions are in place in ClassloaderData.
>
> But yes, I can save us some review work by waiting a bit and then
> doing only one change. Lets hope it does not take too long, I have
> more changes coming up which print class loader names.
>
> So I retract this RFR for now and will repost another patch once
> 8206205 is done.
>
> Thanks, Thomas
>
>> Thanks,
>> David
>>
>>
>> On 20/05/2018 4:49 PM, Thomas Stüfe wrote:
>>>
>>> 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.
>>>
>>> Before:
>>>
>>> "272: ClassLoaderData 0x00007f5ba0538f10 for anonymous class"
>>>
>>>
>>> http://cr.openjdk.java.net/~stuefe/webrevs/8203455-VM.metaspace-display-loader-name-for-anonymous-cld/example-before.txt
>>>
>>> After patch:
>>>
>>> "268: CLD 0x00007ff0c45738f0 for <anonymous class>, loaded by app,
>>> instance of jdk.internal.loader.ClassLoaders$AppClassLoader"
>>>
>>>
>>> http://cr.openjdk.java.net/~stuefe/webrevs/8203455-VM.metaspace-display-loader-name-for-anonymous-cld/example-after.txt
>>>
>>> --
>>> 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,
>>>
>>> Thomas
>>>
>>
More information about the hotspot-runtime-dev
mailing list