<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:DengXian;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Aptos;}
@font-face
{font-family:"\@DengXian";
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:"Segoe UI";
panose-1:2 11 5 2 4 2 4 2 2 3;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
font-size:12.0pt;
font-family:"Aptos",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
span.EmailStyle19
{mso-style-type:personal-reply;
font-family:"Aptos",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;
mso-ligatures:none;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></style>
</head>
<body lang="en-SE" link="blue" vlink="purple" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal">I have tested with latest JDK 24 and do *<b>not</b>* see the issue there, only on JDK 25.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I have attached the output of running that jcmd every 15 seconds when the issue happened on JDK 25.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">The jcmd output log covers 15:38:00 to 15:48:00. I saw the problems in my application between 15:40:00 and 15:45:45.<o:p></o:p></p>
<div>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:16.0pt;font-family:"Arial",sans-serif;color:black">Christian Fredriksson</span><span lang="EN-US" style="font-family:"Times New Roman",serif"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:8.0pt;font-family:"Arial",sans-serif;color:black">T +46 734 63 71 06<br>
<a href="mailto:christian.fredriksson.2@volvocars.com"><span style="color:#1F497D">christian.fredriksson.2@volvocars.com</span></a><br>
<br>
VOLVO CAR CORPORATION</span><span lang="EN-US" style="font-family:"Times New Roman",serif"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt"><o:p> </o:p></span></p>
</div>
<p class="MsoNormal"><span lang="en-SE"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif"> Alan Bateman <alan.bateman@oracle.com>
<br>
<b>Sent:</b> Saturday, 22 November 2025 09:43<br>
<b>To:</b> Fredriksson, Christian <christian.fredriksson.2@volvocars.com>; loom-dev@openjdk.org<br>
<b>Subject:</b> Re: Significant degradation of Thread.sleep with virtual threads in JDK 25 vs JDK 21<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" align="left" width="100%" style="width:100.0%">
<tbody>
<tr>
<td width="0" style="width:.3pt;background:#A6A6A6;padding:5.25pt 1.5pt 5.25pt 1.5pt">
</td>
<td width="100%" style="width:100.0%;background:#EAEAEA;padding:5.25pt 3.75pt 5.25pt 11.25pt;aspect-ratio: revert !important;background:revert !important;block-size: revert !important;border:revert !important;bottom: revert !important;color:revert !important;color-scheme: revert !important;content-visibility: revert !important;cursor:revert !important;direction:revert !important;display:revert !important;font-size:revert !important;height:revert !important;hyphens: revert !important;letter-spacing:revert !important;line-height:revert !important;margin:revert !important;opacity: revert !important;order: revert !important;outline: revert !important;overflow:revert !important;padding:revert !important;position:revert !important;resize: revert !important;rotate: revert !important;scale: revert !important;tab-size: revert !important;table-layout:revert !important;text-align:revert !important;text-indent:revert !important;text-orientation: revert !important;text-overflow: revert !important;text-shadow:revert !important;text-transform:revert !important;text-wrap: revert !important;top:revert !important;transition: revert !important;user-select: revert !important;vertical-align:revert !important;visibility:revert !important;white-space:revert !important;width:revert !important;word-break:revert !important;word-spacing:revert !important;writing-mode:revert !important;zoom: revert !important">
<div>
<p class="MsoNormal" style="mso-element:frame;mso-element-frame-hspace:2.25pt;mso-element-wrap:around;mso-element-anchor-vertical:paragraph;mso-element-anchor-horizontal:column;mso-height-rule:exactly">
<span style="font-size:9.0pt;font-family:"Segoe UI",sans-serif;color:#212121">You don't often get email from
<a href="mailto:alan.bateman@oracle.com">alan.bateman@oracle.com</a>. <a href="https://aka.ms/LearnAboutSenderIdentification">
Learn why this is important</a> <o:p></o:p></span></p>
</div>
</td>
<td width="75" style="width:56.25pt;background:#EAEAEA;padding:5.25pt 3.75pt 5.25pt 3.75pt;aspect-ratio: revert !important;background:revert !important;block-size: revert !important;border:revert !important;bottom: revert !important;color:revert !important;color-scheme: revert !important;content-visibility: revert !important;cursor:revert !important;direction:revert !important;display:revert !important;font-size:revert !important;height:revert !important;hyphens: revert !important;letter-spacing:revert !important;line-height:revert !important;margin:revert !important;opacity: revert !important;order: revert !important;outline: revert !important;overflow:revert !important;padding:revert !important;position:revert !important;resize: revert !important;rotate: revert !important;scale: revert !important;tab-size: revert !important;table-layout:revert !important;text-align:revert !important;text-indent:revert !important;text-orientation: revert !important;text-overflow: revert !important;text-shadow:revert !important;text-transform:revert !important;text-wrap: revert !important;top:revert !important;transition: revert !important;user-select: revert !important;vertical-align:revert !important;visibility:revert !important;white-space:revert !important;width:revert !important;word-break:revert !important;word-spacing:revert !important;writing-mode:revert !important;zoom: revert !important;align: left !important">
</td>
</tr>
</tbody>
</table>
<div>
<div>
<p class="MsoNormal">On 21/11/2025 18:25, Fredriksson, Christian wrote:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<p class="MsoNormal"><span style="color:#212121">Thank you.<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="color:#212121">Unfortunately I've been unable to reproduce it locally outside of our runtime environment, but I do have a reliable reproducer there.<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="color:#212121"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="color:#212121">Would it help if I test this also with JDK 24/23/22?<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="color:#212121"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="color:#212121">Otherwise I can wait until JDK-8370887 is fixed (next release of JDK 25?) and test again then.<o:p></o:p></span></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</blockquote>
<p class="MsoNormal"><br>
If you can see if it reproduces with JDK 24 then it would narrow this down. It would also be useful to capture the output from running `jcmd <pid> Thread.vthread_scheduler` a few times while it executes as this includes info on delayed tasks.<br>
<br>
It's possible it is related to JDK-8370887 but if all the sleeps are sleep(1) and there is no interrupt/cancellation then there may not be replacing going on to observe that issue. It may of course be that the picture is more complicated. In any case, expect
a JDK 26 EA build soon with a fix to that issue.<br>
<br>
You mentioned it reproduces in a single CPU environment. It's possible that is relevant although your message said you also test with jdk.virtualThreadScheduler.parallelism set so that might rule it out.<br>
<br>
-Alan<o:p></o:p></p>
</div>
</div>
</body>
</html>