简体   繁体   中英

Java multithreading peak processor usage

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

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM