class loading deadlock

Patricio Chilano Mateo patricio.chilano.mateo at oracle.com
Tue Dec 16 00:03:01 UTC 2025


Hi Benjamin,

This kind of deadlock, where a platform thread is blocked waiting to 
acquire a monitor and the successor is an unmounted virtual thread that 
cannot run, should be fixed by JDK-8369019.

On 12/15/25 10:47 AM, Benjamin Peterson wrote:
> On Mon, Dec 15, 2025, at 02:40, Alan Bateman wrote:
>> On 15/12/2025 05:41, Benjamin Peterson wrote:
>>> Greetings,
>>> I saw class initialization will be preemptible in many cases in JDK 26, which is exciting. I believe my application is hitting a deadlock due to virtual threads pinned in class loading on OpenJDK 25.0.1.
>>>
>>> I captured a stack dump of the deadlocked application, and I can share the interesting parts of the dump. For background, there are 32 cores, so the virtual thread scheduler pool has 32 carrier threads.
>> The startup when using MR JARs is indeed complicated.
> It looks to me like there's a potential problem anytime class loading can share an exclusive resource with a non-classloading path. (In this stack dump, the CleanerImpl list.)
Yes, class loading has a similar issue to class initialization since 
native frames in the stack prevent threads to be unmounted.

Patricio


More information about the loom-dev mailing list