RFR 6656031: SA: jmap -permstat number of classes is off by 1

Jaroslav Bachorik jaroslav.bachorik at oracle.com
Thu Dec 19 23:21:09 PST 2013


Hi Dmitry,
On 19.12.2013 21:14, Dmitry Samersoff wrote:
> Jaroslav,
>
> Changes looks good for me, but
>
> I would prefer to re-order if at ll. 112 like:
>
>
> LoaderData ld = bootstrapLoaderData;
> Oop loader = ((InstanceKlass) k).getClassLoader();
> if (loader != Null){
>   ld = loaderMap.get(loader)
> }

Could you please elaborate on this? I am not that familiar with all the 
details in the code - why is it necessary to use "loadedMap.get(loader)"?

Thanks,

-JB-

>
> -Dmitry
>
> On 2013-12-17 15:54, Jaroslav Bachorik wrote:
>> Please, review the following fix.
>>
>> Issue : https://bugs.openjdk.java.net/browse/JDK-6656031
>> Webrev: http://cr.openjdk.java.net/~jbachorik/6656031/webrev.00
>>
>> The issue is caused by using SystemDictionary.ClassAndLoaderVisitor to
>> traverse the dictionary classes to get the numbers of the loaded classes
>> per classloader. This visitor will visit all the combinations of a
>> particular class and all its classloaders - the defining CL + all
>> initiating CLs. This will cause completely wrong numbers to be reported.
>>
>> The solution is to use SystemDictionary.ClassVisitor which walks only
>> over the loaded classes (each class exactly once) and extract the
>> defining CL from the visited Klass.
>>
>> Thanks,
>>
>> -JB-
>
>



More information about the serviceability-dev mailing list