4 ms·
These are good points, thank you. BTW, I studied a little deeper, Java actually commits the stack memory upon thread creation. The memory distribution of java
by avodonosov 7y ago
These are good points, thank you.
BTW, I studied a little deeper, Java actually commits the stack memory upon thread creation.
The memory distribution of java process may be seen using jcmd <pid> VM.native_memory as suggested here http://xmlandmore.blogspot.com/2014/09/jdk-8-thread-stack-size-tuning.html http://xmlandmore.blogspot.com/2014/09/jdk-8-thread-stack-si...
But due to Linux memory overcommit this memory is not really allocated.
I've managed to create 127000 Java threads on my machine, and the resident memory of this process, as shown by `top` is 2,167G ~ 17k per thread.
If I disable memory overcommit, only around 32000 threads are created.
- garmaine 7y agoThanks for digging deeper into it, that’s some good info.