What can cause high cpu usage in java?

M

mk

Hi,

what can cause a high cpu usage on a linux server with tomcat and
jdk1.4.1_02?
Our webapplication is unused and the logs of the garbage collector
tell us, that
even the garbage collector seems to be bored; i.e. it works about
every 300 sec.

Nonetheless we have a couple of low prioritized java processes which
share almost the whole cpu (about 90%).

What is java doing when even the garbage collector seems to have
nothing to do?
What can be logged from the VM besides the garbage collector
activities to
gain more information?

Help is urgent, since the system can only be relieved through a tomcat
restart.

Thanks,

Markus
 
R

Robert Olofsson

Roger Irwin ([email protected]) wrote:
: mk wrote:
: > Hi,
: >
: > what can cause a high cpu usage on a linux server with tomcat and
: > jdk1.4.1_02?

: Java (and any other language), will continue to use the CPU if you put
: it in a loop, which frequently happens when polling is used to wait for
: a condition. example:

: while(1){
: if(PollTest==1)break;
: }

And if you have context reloading on tomcat will run a loop quite often.
Try turning it off, it should only be used for development.

/robo
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,756
Messages
2,569,533
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top