3 ms·
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 doe
by chrisseaton 5y ago
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.
- ec109685 5y agoIt allocates the entire stack, but it doesn't write into it, so it doesn't take up resident memory until used.
- chrisseaton 5y agoI'm not a HotSpot expert, but my understanding is it puts the stack through add_reserved_region to commit it.