Debugging a threads problem

Discussion in 'Java' started by Chris, Feb 12, 2006.

  1. Chris

    Chris Guest

    I have a webapp which is slowly increasing the number of threads it
    consumes. This only happens in production; I can't seem to duplicate the
    problem in a test system.

    Is there any way to get a JVM to dump information on the current threads?
    Specifically, I'd like to know what method or class created each thread and
    the time it was created. This might be enough to help me figure out what's
    going on.
    Chris, Feb 12, 2006
    #1
    1. Advertising

  2. Chris

    Daniel Dyer Guest

    On Sun, 12 Feb 2006 19:22:55 -0000, Chris <anon> wrote:

    > I have a webapp which is slowly increasing the number of threads it
    > consumes. This only happens in production; I can't seem to duplicate the
    > problem in a test system.
    >
    > Is there any way to get a JVM to dump information on the current threads?
    > Specifically, I'd like to know what method or class created each thread
    > and
    > the time it was created. This might be enough to help me figure out
    > what's
    > going on.


    Ctrl-Break (Windows) or kill -3 (Linux/Solaris) will cause the JVM to do a
    thread dump.

    In the absence of any other evidence of a bug, I would guess that what you
    are seeing is a thread pool that increases in size as the load goes up but
    doesn't discard idle threads (instead it keeps them alive ready for the
    next time the load spikes).

    Dan.

    --
    Daniel Dyer
    http://www.dandyer.co.uk
    Daniel Dyer, Feb 12, 2006
    #2
    1. Advertising

  3. Chris

    Chris Guest

    >> I have a webapp which is slowly increasing the number of threads it
    >> consumes. This only happens in production; I can't seem to duplicate the
    >> problem in a test system.
    >>
    >> Is there any way to get a JVM to dump information on the current threads?
    >> Specifically, I'd like to know what method or class created each thread
    >> and
    >> the time it was created. This might be enough to help me figure out
    >> what's
    >> going on.

    >
    > Ctrl-Break (Windows) or kill -3 (Linux/Solaris) will cause the JVM to do a
    > thread dump.
    >
    > In the absence of any other evidence of a bug, I would guess that what you
    > are seeing is a thread pool that increases in size as the load goes up but
    > doesn't discard idle threads (instead it keeps them alive ready for the
    > next time the load spikes).


    Thanks. Trouble is, this is a production system and I can't do a kill
    easily. I'm wondering if there is some function I can run from within the
    JVM itself.
    Chris, Feb 12, 2006
    #3
    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. Ben
    Replies:
    1
    Views:
    13,133
    Matt Humphrey
    Jul 21, 2006
  2. yoda
    Replies:
    2
    Views:
    419
    =?utf-8?Q?Bj=C3=B6rn_Lindstr=C3=B6m?=
    Aug 1, 2005
  3. threads without threads

    , Aug 27, 2004, in forum: C Programming
    Replies:
    4
    Views:
    384
    William Ahern
    Aug 27, 2004
  4. Pedro Pinto

    Java Threads - Get running threads

    Pedro Pinto, Apr 8, 2008, in forum: Java
    Replies:
    2
    Views:
    1,404
    Arne Vajhøj
    Apr 9, 2008
  5. Une bévue
    Replies:
    0
    Views:
    132
    Une bévue
    Jun 14, 2006
Loading...

Share This Page