Significant degradation of Thread.sleep with virtual threads in JDK 25 vs JDK 21

Pavel Rappo pavel.rappo at gmail.com
Fri Nov 21 20:46:20 UTC 2025


My two cents: whatever you do to narrow it down will be helpful. I wonder
if along with testing on other JDKs you could also provide a bit more
information on that k8s node and the image you use. You could also build
the simplest image on which the issue is reproducible, and which only
contains publicly available components. If so, you could then share it.

On Fri, Nov 21, 2025 at 6:25 PM Fredriksson, Christian <
christian.fredriksson.2 at volvocars.com> wrote:

> Thank you.
> Unfortunately I've been unable to reproduce it locally outside of our
> runtime environment, but I do have a reliable reproducer there.
>
> Would it help if I test this also with JDK 24/23/22?
>
> Otherwise I can wait until JDK-8370887 is fixed (next release of JDK 25?)
> and test again then.
>
> Regards,
> Christian
>
>
>
>
> ------------------------------
> *From:* Alan Bateman <alan.bateman at oracle.com>
> *Sent:* Friday, November 21, 2025 6:37:52 PM
> *To:* Fredriksson, Christian <christian.fredriksson.2 at volvocars.com>;
> loom-dev at openjdk.org <loom-dev at openjdk.org>
> *Subject:* Re: Significant degradation of Thread.sleep with virtual
> threads in JDK 25 vs JDK 21
>
> You don't often get email from alan.bateman at oracle.com. Learn why this is
> important <https://aka.ms/LearnAboutSenderIdentification>
>
>
> On 21/11/2025 15:52, Fredriksson, Christian wrote:
>
> Hey,
>
>
>
> I believe I have found a bug with JDK 25 and virtual threads, but will
> need some guidance in what information I need to provide in order to file a
> bug.
>
>
>
> Short version: after changing from JDK 21 to JDK 25, doing Thread.sleep(1)
> in a virtual thread now sometimes takes up to 60 seconds (!).
>
>
>
> Thanks for the mail. Do you have a standalone test that uses the loop in
> your mail that we could use to study this?  The timer support has changed
> significantly twice between JDK 21 and JDK 25. From your mail then it could
> be a pathological case that leads to starvation, or it could be related to
> recently reported bug [1].
>
> -Alan
>
> [1] https://bugs.openjdk.org/browse/JDK-8370887
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/loom-dev/attachments/20251121/92fef9e4/attachment.htm>


More information about the loom-dev mailing list