Use only 2 CPU cores with Java

java

Solution

I believe that's something that needs to be handled at the OS level, thus can't be controlled through java code. Take a look at this post. I hope it helps.

Is it possible to force an existing Java application to use no more than x cores?

Problem

Is there a way to code Java application to use only 2 CPU cores of the CPU. For example I want to set a limit of the CPU utilization. Is this possible in Java?

Original source

Related problems