0

I have a piece of code in Scala (using Java execution context) that spawns many threads. Also I have an 8 core CPU.

When the process runs it uses up all the juice my computer has and I cannot do anything else.

Is there a way I can limit the JVM to only 7 cores, or the Java execution context to 7 active threads?

Anton
  • 2,282
  • 26
  • 43
  • Another similar question: http://stackoverflow.com/questions/22741859/deceive-the-jvm-about-the-number-of-available-cores-on-linux – apangin Oct 02 '14 at 07:05

1 Answers1

-1

Use fixed thread pool and set the fixed pool size to 7

Eun Woo Song
  • 750
  • 6
  • 8