Xorg and java hitting 100% CPU

Asked by Peter White

I am running Kubuntu 10.04, 64 bit on a single processor AMD box, with a Radeon 7500 graphics card. Running vassal (which is just a java program), I sometimes see the CPU climb to 100% and stay there for many minutes (before I kill the process, and it all clears up). This is about 35% java CPU and 65% Xorg. It is 100% reproducible, in that if I do the same thing I see the same problem.

Interesting things.
- It only happens when the java program is displaying graphics (mostly static jpeg files), and does not happen on my ubuntu box (totally different hardware though - a laptop). Just running java and looking at windows where jpgs are not displayed does not seem to trigger issues.
- It did not happen when I was running 9.04 or earlier. I upgraded direct from 9.04 to 10.04.

I suspect some kind of incompatibility with the video drivers triggered by java, but would like suggestions what to try next. Should I upgrade java (to what version?), do something with the video drivers, or what? I don't know whether the upgrade changed the JVM or changed the video drivers, or something altogether different.

Java version is as follows :

java version "1.5.0_19"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_19-b02)
Java HotSpot(TM) Client VM (build 1.5.0_19-b02, mixed mode, sharing)

Many thanks for any helpful suggestions,

Question information

English Edit question
Ubuntu xserver-xorg-driver-ati Edit question
No assignee Edit question
Solved by:
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :

Can you give the output of:

uname -a; lsb_release -a


Revision history for this message
Peter White (plw-plwhite) said :

$ uname -a
Linux plwhite 2.6.32-24-generic #39-Ubuntu SMP Wed Jul 28 05:14:15 UTC 2010 x86_64 GNU/Linux
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 10.04.1 LTS
Release: 10.04
Codename: lucid

Revision history for this message
Best actionparsnip (andrew-woodhead666) said :

Try 64bit java. You are most likely running 32bit java through a wrapper (inefficient). BEFORE you do this stuff you need to remove the current Java.

mkdir j; wget http://javadl.sun.com/webapps/download/AutoDL?BundleId=40911; mv ./jre* ./j; cd ./j; mv ./jre* ./java; chmod +x ./java; sudo mv ./java /opt; cd /opt; sudo ./java; rm ./java

You can now scroll this down with the enter key then type 'yes'. This will now extract.

You can now run:

sudo find . -name "libnpjp2.so"

To find the browser plugin, you can then symlink this file in your browsers plugins folder.


Revision history for this message
actionparsnip (andrew-woodhead666) said :

Using this method will mean you will need to manually check for upgrades for Java but this 64bit Java rather than a 32bit Java running through a 64bit wrapper is much more graceful.

Revision history for this message
Peter White (plw-plwhite) said :

Thanks actionparsnip, that solved my question.

Revision history for this message
Peter White (plw-plwhite) said :

Just to clarify, I didn't actually replace my java installation, but installed the 64 bit version in parallel in a tmp directory, then used that version (so the version used by my browser has not changed, but the one I ran from the command line has). This appeared to work fine.

Revision history for this message
Peter White (plw-plwhite) said :

And because I realise I rudely never said it earlier, many thanks for a prompt and accurate answer. Very much appreciated.