Java very limited on max number of threads?

后端 未结 6 1589
萌比男神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:51

    Use asynchronous IO (java nio) and you'll don't need 7k threads to support 7k clients, a few threads for handling io (5?) will be enough.
    Take a look at Netty ;)

    One thread for each client is a really bad design.

提交回复
热议问题