<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><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:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style></head><body lang=EN-US link=blue vlink="#954F72" style='word-wrap:break-word'><div class=WordSection1><p class=MsoNormal>I was doing some testing with Platform/Virtual Threads on Linux/Mac/Windows. Starting 1 millions virtual threads worked fine for all three platforms as expected. No problems there. </p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>For both Linux and Mac, trying to starting a million “Platform” threads failed as expected after a few thousand threads. I get the memory exception when starting the thread. This behavior is expected because the stack size of 1M is allocated upfront to a thread and program will give memory error when all machine memory is used up. </p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>However, for Windows (16G RAM, Intel I7, Windows11) – the behavior is not consistent with Linux or Mac and I do not understand the behavior. Windows never gives the memory exception at all. When I start the platform threads (-Xmx1G), I let it sleep for 5 hours (because of the time it takes to start the threads) and terminate. I was curious after how many parallel platform threads it will fail. Surprisingly, windows was able to create 430,000 concurrent “platform” threads but it did not give a memory error.  The process memory in windows Task Manager showed “5G” and the total machine memory maxed at 16G and still the program did not give any memory error. Finally after creating 430K platform threads, I could see the process just hosed and gave up (no messages were shown) BUT still no memory error. I suspect that the process was hosed a long time back because jconsole connected to it stopped responding. </p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Does windows not allocate the 1M stack memory per thread upfront ? Does windows not have upper limit to process memory (It was using 5G memory) ? And how is the java process continuously creating platform threads when the machine memory is maxed out ? </p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Any insight on this behavior is appreciated – though these look more like Windows questions.</p><p class=MsoNormal><o:p> </o:p></p></div></body></html>