I've encountered that the java-process is
- started without any reasing (while no java-application should be run) and
- after a while uses 100% of the CPU (AMD Phenom II X4)
I kill it with the gnome system monitor. After some seconds, the process appears again, using again 100% of CPU (status: sleep).
I'm also irritated about the fact, that
$ jobs
does not return anything. I'll tried
sudo jobs
for fun and got the message
sudo: jobs: command not found
but jobs of course is installed.
I have installed OpenJDK Java 6 Runtime via the Software Center.
How can I
- find out if there is still a programm running which uses java
- why the process takes that much CPU?
jobs
only shows the processes owned by the current shell (it's a shell built-in function -- and that's why you can't run it with sudo, that runs only executable programs). It usually does not show anything unless you started it in background. Seehelp jobs
.You can check if there are any other java processes running with:
This searchs for any running process which has the string "java" on its command line execution, including grep. You can eliminate grep using
ps aux | grep java | grep -v grep
, if you want.Also, when a process is eating a lot of CPU, you usually can spot it using the program
top
, pressing P to order by %CPU:You can also use M to sort by memory usage, and use the keys < and > to change the current field used to sort.
Now, WHY a process is taking much CPU is a really hard question to answer in a generic way. It may be doing useful stuff or it may be just stuck on an infinite loop, usually only by reading the source code you could find out which. If you were to consider the Java JRE that runs the Java plugins in your browser, its CPU load is highly dependant on the nature of the program you are running.