3 ms·
First of all, 512GB of RAM isn't that unusual. If you are supporting a million clients, most applications will need a beefy server. If only 0.1% of your clients
by akvadrako 4y ago
First of all, 512GB of RAM isn't that unusual. If you are supporting a million clients, most applications will need a beefy server. If only 0.1% of your clients are active, that's 1000 cores.
Secondly, you don't need 512kb per thread. The kernel will only use pages that are actually used, so by default new threads will use 4kb.
- chrisseaton 4y agoI 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 4y agoIt allocates the entire stack, but it doesn't write into it, so it doesn't take up resident memory until used.
- chrisseaton 4y agoI'm not a HotSpot expert, but my understanding is it puts the stack through add_reserved_region to commit it.