I do understand that platform threads are expensive as it needs more memory and it's prone to CPU context switching.
But in case of virtual threads where an unimaginably large number of virtual threads can be served by a handful of platform threads, doesn't the virtual threads still need memory space to passivate the context/stack and then attach it to the carrier thread?
How does it make a difference in terms of memory?
Why doesn't spinning 10000 virtual threads die out of memory while 10000 platform thread does?
Both of them need the same stack? And the context where the application related information need to be maintained, right?
Is there any extra overhead in the memory that's only applicable to the platform threads and this is the reason why we say virtual threads are "lighter" in memory? If so what's that that makes this difference?