RFR: 8193513: add support for printing a stack trace on class loading [v2]
Doug Simon
dnsimon at openjdk.org
Wed Jun 21 06:59:06 UTC 2023
On Wed, 21 Jun 2023 05:58:53 GMT, David Holmes <dholmes at openjdk.org> wrote:
>> Doug Simon has refreshed the contents of this pull request, and previous commits have been removed. The incremental views will show differences compared to the previous content of the PR. The pull request contains one new commit since the last revision:
>>
>> added TraceClassLoadingCause flag
>
> src/hotspot/share/oops/instanceKlass.cpp line 3747:
>
>> 3745: stringStream st;
>> 3746: st.print_cr("Loading %s", external_name());
>> 3747: JavaThread::current()->print_stack_on(&st);
>
> If this is called for a class loaded very early in VM initialization you may not yet have a current thread.
When I use `-XX:TraceClassLoadingCause=*`, it all works which suggests there's always a current thread by the time class loading occurs. That said, I will add a null check just to be sure.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/14553#discussion_r1236467579
More information about the hotspot-dev
mailing list