1

I'm not sure if this is a vague question, if it is then I would be more than happy to be pointed a direction to get some clarity.

I've got a bunch of Java Tests (30 to be precise) that gets run using a Parallel Runner (it uses a Threadpool).

Each test takes about 1 minute (if they were to run in isolation, they are endtoend tests). However, when they are run in parallel, it takes about 10 minutes. I haven't set up any heap size as a JVM arg.

Using the top command, I see that my CPU is utilised more than 110% when these are run in parallel. Also observing a few context switches when they are run (sometimes in tens sometimes in 100s and rarely in 1000s).

Wondering if increasing the JVM Heap Size would improve the situation a bit or this is completely a unrelated parameter to solve this? If it is unrelated, then I'd like to hear why. Thanks.

user1189332
  • 1,773
  • 4
  • 26
  • 46
  • 1. Don't ask us when you can test it yourself 2. What do you expect/want to happen, no context switches at all? – Kayaman Dec 18 '15 at 17:32
  • It depends on what your tests do. Do they generate a bunch of garbage, causing GCs to possibly slow down your program? You shouldn't just raise max heap blindly, rather than tune your heap by adjusting the heap ratio to better fit your application (if a lot of short-lived objects are created and you want to lower GCs, increase the size of your young gen). The best way to determine these things would be to profile your application. – Vince Dec 18 '15 at 18:13

0 Answers0