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

It’s called setting CPU affinity, and it’s an OS setting for processes, not specific to Java.

On Linux: http://www.cyberciti.biz/tips/setting-processor-affinity-certain-task-or-process.html

On Windows: http://www.addictivetips.com/windows-tips/how-to-set-processor-affinity-to-an-application-in-windows/

On Mac it doesn’t look like you can set it: https://superuser.com/questions/149312/how-to-set-processor-affinity-on-os-x

Leave a Comment