[jdk18] RFR: 8273107: RunThese24H times out with "java.lang.management.ThreadInfo.getLockName()" is null
Daniel D.Daugherty
dcubed at openjdk.java.net
Wed Dec 15 22:30:07 UTC 2021
On Wed, 15 Dec 2021 18:28:58 GMT, Daniel D. Daugherty <dcubed at openjdk.org> wrote:
>> src/hotspot/share/services/threadService.cpp line 692:
>>
>>> 690: ObjectMonitorsHashtable::PtrList* list = table->get_entry(_thread);
>>> 691: if (list != nullptr) {
>>> 692: ObjectSynchronizer::monitors_iterate(&imc, list, _thread);
>>
>> The InflatedMonitorsClosure walks the stack until object is found with this method:
>> ThreadStackTrace::is_owned_monitor_on_stack(oop object)
>> for every object...
>>
>> If you instead just collect all locks on stack with one pass you don't have to walk the stack over and over, which should be major speedup.
>
> Sounds like an interesting RFE, but I'd prefer that be investigated
> separately from this bug.
Clarification: ThreadStackTrace::is_owned_monitor_on_stack() is not actually
walking the (JavaThread's) stack, but it is walking the collection of
StackFrameInfo objects that was gathered earlier in
ThreadStackTrace::dump_stack_at_safepoint(). Adding a gather-locked-monitor
helper object to the "add_stack_frame()" call would provide an easy hook and
then InflatedMonitorsClosure could use the new helper object. Something like
that anyway...
-------------
PR: https://git.openjdk.java.net/jdk18/pull/25
More information about the hotspot-runtime-dev
mailing list