Java very limited on max number of threads?

后端 未结 6 1590
萌比男神i
萌比男神i 2021-02-08 07:53

We have a small text box with 512Mb of ram. We wanted to see how many threads we can create in Java in this box. To our surprise, we can\'t create many. Essentially the minimum

6条回答
  •  爱一瞬间的悲伤
    2021-02-08 08:40

    You don't necessarily need one thread per client session. If you look at the way that a J2EE (or JavaEE) server handles multiple connections it uses a mixture of strategies including concurrency, queuing and swapping. Usually you can configure the maximum number of live concurrent instances and idle time-out values at deployment time to tune the performance of your application.

提交回复
热议问题