Guide to Java Virtual Threads
&gt; The problem with platform threads is that they are expensive from a lot of points of view. First, they are costly to create. Whenever a platform thread is made, the OS must allocate a large amount of memory (megabytes) in the stack to store the thread context, native, and Java call stacks. This is due to the not resizable nature of the stack. Moreover, whenever the scheduler preempts a thread from execution, this enormous amount of memory must be moved around.<p>Scheduler pre-emption does not cause stack memory to be copied. Perhaps they&#x27;re thinking of registers.<p>(As an side, suspension and resumption of Java virtual threads <i>does</i> result in its stack being copied--saved and restored--as this was deemed less costly[1] than growable stacks, which is how Go works.)<p>&gt; As we can imagine, this is a costly operation, in space and time. In fact, the massive size of the stack frame limits the number of threads that can be created. We can reach an OutOfMemoryError quite easily in Java, continually instantiating new platform threads till the OS runs out of memory:<p>Stack frame != stack.<p>The author seems confused about some concepts. I didn&#x27;t read beyond this so don&#x27;t know whether that confusion effected any of their conclusions or advice.<p>[1] EDIT: Whether less costly in terms of performance or development effort I&#x27;m not sure. A major reason JavaScript and many other languages don&#x27;t implement stackfull coroutines is that the virtual machines--interpreters, JITs, etc--are written in a way that in-language function calls and recursion directly or indirectly rely on the underlying native &quot;C&quot; stack. This correspondence is not something you can typically remedy without <i>completely</i> rewriting the implementation from scratch. Language implementations like Go and Lua and were written from the beginning to avoid this correspondence. To accomplish stackfull coroutines languages like Java and, IIUC, OCaml really had no choice but to rely on some other tricks, though I think OCaml permitted some tricks not available to Java, because OCaml could do some transforms which Java couldn&#x27;t given the nature of the JVM.