Where did the figure 35K come from, and how was it calculated?
sobes.tech AI
Answer from AI
The number 35K is often encountered in the context of estimating the maximum number of threads or connections that a JVM or application can support. Historically, it may have arisen from thread stack size limitations or practical measurements.
For example, if a thread stack by default takes up 1 MB, and you have 32 GB of RAM, you could theoretically create about 32,000 threads (32 GB / 1 MB = 32,768). Considering overheads and other resources, it roughly amounts to 35 thousand.
Thus, the number 35K is an approximate estimate of the maximum number of threads based on stack size and available memory. It helps in planning the architecture of multithreaded applications and understanding JVM limitations.
Specific calculation:
- Thread stack size (e.g., 1 MB)
- Total available memory for stacks
- Dividing memory by stack size
This gives the maximum number of threads that can be created without exhausting memory.