It loads 100% from one of the CPUs at a time. Is that on purpose? Shouldn't it try to do 25/25/25/25?

It's an Intel i5-3320M - 2,60GHz x 4

My friend on a win10 is load-balancing 'correct' loading the same file. (it's an insanely huge .osm that we're parsing in IntelliJ)

Image of my System monitor

  • 6
    It depends on the process you run. Not all programs allow multithreading.
    – Pilot6
    Mar 10 '17 at 11:20
  • If whatever you're running is only written to support using one thread, then yes, that's to be expected. Look in it's settings and check if it has an option for number of threads / cores to use, if not, you'll need to find some other way of multithreading it, or ask the developer to implement it.
    – JonasCz
    Mar 10 '17 at 11:23
  • My friend - running win10 - is doing the exact same. His cores seperate the load correctly. (IntelliJ IDE)
    – Seyb
    Mar 10 '17 at 11:59
  • It's not uncommon for the Windows and Linux implementations of a program to differ in significant ways. This is usually due to lazy programming or lack of development resources -- developers using one system do the minimum to get the program to work on the other.
    – Zeiss Ikon
    Mar 14 '17 at 12:18

4 × 0.25 is the same as 1.

It looks like a single-threaded task is scheduled to run on multiple CPUs in a round-robin manner, which is what Windows does to distribute computational and therefore electrical and thermal load between different chip areas to improve heat dissipation. This has nothing to do with multi-threading and is just an artefact of the different scheduling strategies of Windows and Linux.

  • It's actually dumb of Windows since the core that was last executing the thread already has its caches full of data the thread is likely to want, so you lose performance by shifting it to another core with cold caches. Frequent switching also can prevent the other cores from going into their lowest power state.
    – psusi
    Mar 16 '17 at 13:31
  • @psusi: According to Microsoft's benchmarks this is less of an issue than excess heat with a single multi-core x86 CPU. Their cores either share their caches or have sufficiently fast access to each other's caches. (An exception to this are AMD's Ryzen desktop CPUs which are actually two CPUs on a single die with multiple cores each; this could be fixed by a tweak that makes the scheduler aware of the NUMA nature of the CPU cores). Additionally, if high performance really is an issue the application will try to use parallel computing which avoids this scheduling strategy altogether. Mar 16 '17 at 14:39
  • They share the same L3 cache, but not L1 and L2. They also have separate TLBs that get flushed every time a different thread is switched to. This boils down to best performance is from keeping one busy thread on the same cpu, which is why they provided a way to set the allowed cpu mask to do this manually. Linux figured out how to mostly do it automatically but Windows never did.
    – psusi
    Mar 16 '17 at 15:59
  • @psusi: It depends heavily on the workload whether the resulting L1 and L2 cache misses will have a relevant impact. During many workloads (especially in a typical desktop environment) the CPU spends far more time waiting on RAM due to cache misses on all levels anyway. Mar 17 '17 at 0:53

It looks like you have one very busy (not multi-threaded) program that occupies one cpu. I bet you find one process with almost 100% CPU load in an abnormal state ("almost crashed") - e.g. Firefox with a lot of open tabs and JavaScript sucking power. Running ps aux on the console should give you the culprit. The steadily increasing memory consumption might also be caused by this process. Most other processes run more or less well distributed on the other CPUs, giving you the 10-20% load to be expected.

  • Just editted my OP. It seems like my friends computer is load-balancing correctly on win10 (IntelliJ IDE huge file parsed)
    – Seyb
    Mar 10 '17 at 12:10

That is possible only if the program allows multi-threading. If the task itself does support muliti-threading, then it cannot be parallelized. For example, Newton-Raphson method.

But, your cpu does not primarily use the same core everytime, but chooses one of the cores randomly for the program. For example time, a different core reaches 100% when the program is run every time.

System Monitor Graph:

enter image description here

  • Just editted my OP. It seems like my friends computer is load-balancing correctly on win10 (IntelliJ IDE huge file parsed)
    – Seyb
    Mar 10 '17 at 12:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.