What can cause high cpu usage in java?

Discussion in 'Java' started by mk, Jul 25, 2003.

  1. mk

    mk Guest

    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
     
    mk, Jul 25, 2003
    #1
    1. Advertising

  2. Roger Irwin () 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
     
    Robert Olofsson, Jul 25, 2003
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Arandil
    Replies:
    1
    Views:
    1,337
    Arandil
    Apr 12, 2004
  2. rajatag
    Replies:
    6
    Views:
    603
    rajatag
    Feb 1, 2006
  3. Jerry L. Gubka

    Web Page = High CPU Usage?

    Jerry L. Gubka, Jan 3, 2004, in forum: HTML
    Replies:
    2
    Views:
    787
  4. Damien

    High CPU Usage

    Damien, May 15, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    5,013
    bmassicotte
    Jul 13, 2008
  5. Krist
    Replies:
    6
    Views:
    1,975
Loading...

Share This Page