RFR(S) 8193184: NMT: Report array class count in NMT summary

coleen.phillimore at oracle.com coleen.phillimore at oracle.com
Mon Feb 5 18:38:55 UTC 2018



On 2/5/18 1:36 PM, Zhengyu Gu wrote:
> Hi Coleen,
>
> On 02/05/2018 01:15 PM, coleen.phillimore at oracle.com wrote:
>>
>> Hi Zhengyu,
>>
>> This looks really good.  The instanceKlass count does seem to belong 
>> to ClassLoaderData.
>
> You want to move both counters to ClassLoaderData, or just instanceKlass?
>
> To me, CLD is per-classloader metadata, CLDG is where aggregates all 
> class loader metadata, and the counters aggregate all class loaders, 
> that why I put them there.
>
> I am okay to move to CLD if you insist.

Oh, both counters belong where you put them.  It looks good.  Sorry I 
was unclear.
>
>>
>> http://cr.openjdk.java.net/~zgu/8193184/webrev.00/src/hotspot/share/classfile/classLoaderData.hpp.udiff.html 
>>
>>
>> + static void inc_instance_classes(size_t count) {
>> + Atomic::add(count, &_num_instance_classes);
>> + }
>> +
>> + static void dec_instance_classes(size_t count) {
>> + assert(count <= _num_instance_classes, "Sanity");
>> + Atomic::sub(count, &_num_instance_classes);
>> + }
>> +
>> + static void inc_array_classes(size_t count) {
>> + Atomic::add(count, &_num_array_classes);
>> + }
>> +
>> + static void dec_array_classes(size_t count) {
>> + assert(count <= _num_array_classes, "Sanity");
>> + Atomic::sub(count, &_num_array_classes);
>> + }
>>
>>
>> Can you move these functions to classLoaderData.inline.hpp?
>>
> Will do
>
>> Maybe you should add an NMT test for this to verify the output?
> Will do.

Thanks!
Coleen
>
> Thanks,
>
> -Zhengyu
>
>>
>> Thanks,
>> Coleen
>>
>>
>> On 2/2/18 3:28 PM, Zhengyu Gu wrote:
>>> Please review this patch that adds array class count to NMT report, 
>>> so the class count can closely match the output from GC.class_stats.
>>>
>>> For example:
>>> Summary:
>>> -                     Class (reserved=1069781KB, committed=1069269KB)
>>>                             (classes #3362)
>>>                             (  instance classes# 3105, array 
>>> classes#257)
>>>
>>> Summary diff:
>>> -                     Class (reserved=1071843KB +2061KB, 
>>> committed=1070051KB +781KB)
>>>                             (classes #3405 +43)
>>>                             (  instance classes# 3143 +38, array 
>>> classes#262 +5)
>>>
>>> Bug: https://bugs.openjdk.java.net/browse/JDK-8193184
>>> Webrev: http://cr.openjdk.java.net/~zgu/8193184/webrev.00/
>>>
>>> Test:
>>>   hotspot_tier1_runtime on Linux 64 (fastdebug and release)
>>>
>>> Thanks,
>>>
>>> -Zhengyu
>>>
>>



More information about the hotspot-runtime-dev mailing list