RFR: 8264644: Add PrintClassLoaderDataGraphAtExit to print the detailed CLD graph [v2]

David Holmes dholmes at openjdk.java.net
Tue Apr 6 01:55:25 UTC 2021


On Fri, 2 Apr 2021 16:12:49 GMT, Yi Yang <yyang at openjdk.org> wrote:

>> Trivial chanage to make debugging happy, now cld->print() would be:
>> 
>> ClassLoaderData(0x00007ff17432b670)
>>  - name                'platform'
>>  - holder              WeakHandle: 0x00000007fef56678
>>  - class loader        0x7ff17432b828
>>  - metaspace           0x7ff17468a0b0
>>  - unloading           false
>>  - class mirror holder false
>>  - modified oops       true
>>  - keep alive          0
>>  - claim               strong
>>  - handles             43
>>  - dependency count    0
>>  - klasses             {java.sql.SQLFeatureNotSupportedException,java.sql.SQLNonTransientException,java.sql.SQLException,sun.util.resources.provider.NonBaseLocaleDataMetaInfo,org.ietf.jgss.GSSException,javax.sql.DataSource,java.sql.Wrapper,javax.sql.CommonDataSource,java.sql.Time,java.sql.Date,java.sql.Timestamp,sun.util.resources.cldr.provider.CLDRLocaleDataMetaInfo, }
>>  - packages            0x7ff17432bc20
>>  - module              0x7ff17432c520
>>  - unnamed module      0x7ff17432c3d0
>>  - dictionary          0x7ff17432c470
>>  - deallocate list     0x7ff0a4023bd0
>
> Yi Yang has updated the pull request incrementally with one additional commit since the last revision:
> 
>   new flag PrintClassLoaderDataGraphAtExit

Hi Yi,

Approval in principle, but some changes requested, please see below.

Thanks,
David

src/hotspot/share/classfile/classLoaderData.cpp line 952:

> 950:     out->print_cr("");
> 951:   }
> 952:   out->print_cr(" - class loader        %p", _class_loader.ptr_raw());

We don't use  the %p in VM shared code as it behaves differently across platforms - use PTR_FORMAT.

src/hotspot/share/oops/method.cpp line 2260:

> 2258: void Method::print_jmethod_ids(const ClassLoaderData* loader_data, outputStream* out) {
> 2259:   out->print("%d", loader_data->jmethod_ids()->count_methods());
> 2260: }

This method is pointless if it only prints the count to the stream without any descriptive text. Just delete it and print the method count directly in the caller.

-------------

Changes requested by dholmes (Reviewer).

PR: https://git.openjdk.java.net/jdk/pull/3323


More information about the hotspot-dev mailing list