3 ms·
Except that the memory overhead for each thread is MUCH higher: the default would be 1Mb for most JVM implementation. Yes, you can change the thread stack size
by unscaled 7y ago
Except that the memory overhead for each thread is MUCH higher: the default would be 1Mb for most JVM implementation.
Yes, you can change the thread stack size, but that's a global fixed size for all threads, so you can't make it to small, or you'll risk stack overflows.
Meanwhile, Go is using dynamically growing stacks, starting at 2k.
- nvarsj 7y agoIt doesn’t actually use 1mb. Only if the stack touches the pages will it ever allocate the physical memory. Most threads won’t use more than 16kB (the lower bound when I last tested it on x64). Still, it’s a lot larger than green threads.