News for hackers. Stuff that matters.
Re:JEP proposed to target JDK 19: 425: Virtual Threads (Prev... by chrisseaton on Monday May 02, 2022 @02:02PM (#31238567)
I think, but can't prove right now, that Java pre-commits the stack so it has enough head-room to deal with exceptions. Maybe it shouldn't, but it currently does.

And the point still-stands - hardware threads are heavier than virtual threads.

Re:JEP proposed to target JDK 19: 425: Virtual Threads (Prev... by ec109685 on Monday May 02, 2022 @06:55PM (#31242185)
It allocates the entire stack, but it doesn't write into it, so it doesn't take up resident memory until used.
Re:JEP proposed to target JDK 19: 425: Virtual Threads (Prev... by chrisseaton on Monday May 02, 2022 @07:06PM (#31242296)
I'm not a HotSpot expert, but my understanding is it puts the stack through add_reserved_region to commit it.