Why does select() consume so much CPU time in my program?

后端 未结 4 1296
南旧
南旧 2020-12-08 07:08

I have several Java applications that use MINA, and all of them use 20 MINA threads. One application serves around 10,000 concurrent connections, that are usually idle but r

4条回答
  •  攒了一身酷
    2020-12-08 07:41

    Firstly, it's good that both applications have the same issue; it probably indicates that the issue is with either the JVM or the OS and not your application :-)

    As jzd mentioned, nio.select() has had issues. The multiplication of {various versions of Java} x {various platforms, kernel versions} makes it seem like an all-over-the-place issue. I hope one of these works for you :

    • If you are on Linux, try the 2.6 kernel just in case you are on 2.4

      , assuming the bug is akin to : http://bugs.sun.com/view_bug.do?bug_id=6670302

    • Use an older version of the JRE / JDK, not the latest version!

      , i.e., go back to JRE 6 / JDK 6 instead of 7.

    Try

    • {older version of JRE (6), older version of Linux kernel} or
    • {newer version of JRE (7), newer version of Linux kernel}

    instead of mixing them up as in {older, newer} or {newer, older}.

提交回复
热议问题