OpenJDK JVM does not schedule threads on multiple cores

醉酒当歌 提交于 2020-01-02 04:48:07

问题


When I run my multi-threaded Java program on the OpenJDK 6 JVM that is distributed with Ubuntu 12.04, all threads are scheduled on a single core. But when I run the exact same program on the JVM from Oracle's latest 1.7 JDK, it nicely rotates my 20 threads around all 24 available cores. The OpenJDK documentation explains that Java threads will be assigned to native threads, but it doesn't seem to be working. Could there be something configured wrong in my OpenJDK installation, or does it not really support multicore hardware?

OpenJDK:

java version "1.6.0_27"
OpenJDK Runtime Environment (IcedTea6 1.12.6) (6b27-1.12.6-1ubuntu0.12.04.2)
OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode)

Oracle JDK:

java version "1.7.0_40"
Java(TM) SE Runtime Environment (build 1.7.0_40-b43)
Java HotSpot(TM) 64-Bit Server VM (build 24.0-b56, mixed mode)

来源:https://stackoverflow.com/questions/19072133/openjdk-jvm-does-not-schedule-threads-on-multiple-cores

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!