0

I seem to have a strange reading on the processor usage of a heavily loaded multi-threaded Java application (started using the Client JVM).

The problem is that even under heavy load, the processor usage peaks at 99.9% (seen using the top system utility on a Debian Linux Kernel 2.6). This seems strange, as the server is an 8 core, and I would thus expect something heading into >100% teritory for heavy load.

Are there any JVM options that I should consider or any system parameters I should have a look into?

I am currently using the following parameters for JVM startup:

  java -XX:PermSize=128M -XX:MaxPermSize=512M -Xss1024k -Xms512M -Xmx2048M
5
  • Ok, is 99.9% utilization really strange for high processor load. How much higher should it be to really load the processor? Commented Nov 26, 2012 at 11:30
  • What happens if you press I (that's capital i) to toggle Irix mode while in top? Commented Nov 26, 2012 at 11:37
  • @Hristo Iliev - it goes down to about 18%. It's at 6-10%. The server is 8 core * 2 threads. Commented Nov 26, 2012 at 11:46
  • @Val: I was really hoping for 99.99%. Commented Nov 26, 2012 at 11:46
  • Is it fixed to 99.9% all the way through? Or does it go up and down? Commented Nov 30, 2012 at 13:20

2 Answers 2

1

The most likely cause of the observed processor usage is that your application has an concurrency bottleneck that is effectively limiting it to the speed of a single thread on average.

Changing JVM options is unlikely to make a significant difference. What you need to use a Java performance analyser to figure out where the bottlenecks are, and figure out how to eliminate them.

Sign up to request clarification or add additional context in comments.

4 Comments

I was thinking the same thing, but isn't it strange that the processor usage peaks at 99.9%? If a bottleneck was at the root of the problem, then I would think that processor usage would be stuck somewhere bellow that level. Using 99.9% of only one processor sugests that the application would need more CPU power for process intensive tasks and doesn't get it.
Thinking about it... not necessarely. If all threads wait for a single other thread that IS processor intensive, than the above situation would arise. True. I'll profile it some more. Thank you.
Ok, I checked the profiler and for the exact same system pid it reportes a mean CPU usage of less than 15%. The top system utility detects a 99.9% CPU usage during the same interval. I'm quite puzzled.
@TudorVintilescu, the reading of the profiler is consistent with what you see in top with Irix mode off. It shows the utilisation of the total available CPU power, while in Irix mode you see the utilisation related to a single CPU.
1

heavily loaded multi-threaded Java application (started using the Client JVM).

That sounds like a bad idea. The Client VM is design for small, light weight applications such as applets on 32-bit systems. I suggest you using the Server VM which is the default on Linux, Solaris and 64-bit Windows.

This seems strange, as the server is an 8 core, and I would thus expect something heading into >100% teritory for heavy load.

This means your application is effectively single threaded. You may be trying to use multiple threads but unless they can act independantly, they cannot run more than one at a time.

Are there any JVM options that I should consider or any system parameters I should have a look into?

Command line options have no control over this. It is entirely down to how your threads interact.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.