I wrote a computationally heavy single threaded program, but when I executed it I was surprised to see that my quad core processor was at 95% utilization. I was expecting to see something close to 25% utilization (one core). I used the Process Explorer from sysinternals and was further surprised to see that the Java process had six threads with almost identical load distribution of about 16% total processor time.
Initially I was planning to parallelize my code, but now it seems that I won't gain any performance since the CPU is already at 95% load even with my non-parallel code.
It almost appears that Java is somehow automatically parallelizing my code, but everything on the net tells me that this cannot be true. Does anyone know what's going on?
Edit: I added some screenshots to hopefully answer some of the questions below:
System at idle - 1% load. I am uisng a quad core CPU with 8 logical cores.
My non-parallel java program running. Note that all 4 cores are nearly maxed out:
View of my non-parallel java program from SysInternals Process Explorer. Note the 8 threads with nearly identical load: