multithreading Java cannot fully use all the OS cores on Windows -


i have 2 machines same hardware settings: intel i7 cpu (4 cores, 8 threads or virtual cores) 16gb memory. difference 1 machine runs windows 7, , other hosts ubuntu.

my multi-threading program has 8 threads doing similar tasks. noticed when running on windows machine, 4 virtual cores running 30% cpu usage, , rest 4 virtual cores have 0 cpu usage. when same program runs on ubuntu machine, 8 virtual cores have equal cpu usage of 30%.

besides, program runs faster on ubuntu machine.

why java not use cpu cores on windows? there particular jre/os setting?

more details on system info:

  • windows 7 64 bit, oracle 64 bit java 1.7
  • ubuntu 14.04 lts 64 bit, openjdk 64 bit java 1.7

more details on task:

  • one thread read file, initiate instances, feed them input buffer (linkedblockingqueue).
  • eight threads calculate measures each given instances. calculation results fed output buffer (linkedblockingqueue).
  • one thread write results file (sort of intensive i/o here).


Comments

Popular posts from this blog

node.js - Using Node without global install -

How to access a php class file from PHPFox framework into javascript code written in simple HTML file? -

java - Null response to php query in android, even though php works properly -