Mysteriously appearing Timer thread does not allow JVM to die

Discussion in 'Java' started by cprakash@gmail.com, Sep 18, 2006.

  1. Guest

    Hi All,
    In my application, a "Timer-1" thread seems to appear out of nowhere
    and it does not let the application to shut down. This thread belongs
    to a ThreadGroup that I create within the application and it starts
    while another thread of the same ThreadGroup is executing. I am able to
    pinpoint to fixed block of code during the execution of which, this
    thread appears.
    I did like to know if there is a way I can track and find out where
    this thread is starting from ?

    thanks in advance,
    Chandresh

    Here is what I get on Ctrl+Brk:

    Full thread dump Java HotSpot(TM) Client VM (1.5.0_02-b09 mixed mode,
    sharing):

    "Timer-1" prio=5 tid=0x02e37df8 nid=0x9a8 in Object.wait()
    [0x033cf000..0x033cf9
    e8]
    at java.lang.Object.wait(Native Method)
    - waiting on <0x23189cf8> (a java.util.TaskQueue)
    at java.lang.Object.wait(Object.java:474)
    at java.util.TimerThread.mainLoop(Timer.java:483)
    - locked <0x23189cf8> (a java.util.TaskQueue)
    at java.util.TimerThread.run(Timer.java:462)

    "DestroyJavaVM" prio=5 tid=0x00037948 nid=0xfc waiting on condition
    [0x00000000.
    ..0x0007fae8]

    "Low Memory Detector" daemon prio=5 tid=0x00a6dda0 nid=0x95c runnable
    [0x0000000
    0..0x00000000]

    "CompilerThread0" daemon prio=10 tid=0x00a6c978 nid=0xb8 waiting on
    condition [0
    x00000000..0x02c0f6c0]

    "Signal Dispatcher" daemon prio=10 tid=0x00a6bc10 nid=0x188 waiting on
    condition
    [0x00000000..0x00000000]

    "Finalizer" daemon prio=9 tid=0x00a68fd0 nid=0xb88 in Object.wait()
    [0x02b8f000.
    ..0x02b8fa68]
    at java.lang.Object.wait(Native Method)
    - waiting on <0x23074288> (a java.lang.ref.ReferenceQueue$Lock)
    at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:116)
    - locked <0x23074288> (a java.lang.ref.ReferenceQueue$Lock)
    at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:132)
    at
    java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:159)

    "Reference Handler" daemon prio=10 tid=0x00a46af8 nid=0xa2c in
    Object.wait() [0x
    02b4f000..0x02b4fae8]
    at java.lang.Object.wait(Native Method)
    - waiting on <0x23074308> (a java.lang.ref.Reference$Lock)
    at java.lang.Object.wait(Object.java:474)
    at
    java.lang.ref.Reference$ReferenceHandler.run(Reference.java:116)
    - locked <0x23074308> (a java.lang.ref.Reference$Lock)

    "VM Thread" prio=10 tid=0x00036318 nid=0x3a4 runnable

    "VM Periodic Task Thread" prio=10 tid=0x00a6efe8 nid=0xffc waiting on
    condition
    , Sep 18, 2006
    #1
    1. Advertising

  2. wrote:
    > Hi All,
    > In my application, a "Timer-1" thread seems to appear out of nowhere
    > and it does not let the application to shut down. This thread belongs
    > to a ThreadGroup that I create within the application and it starts
    > while another thread of the same ThreadGroup is executing. I am able to
    > pinpoint to fixed block of code during the execution of which, this
    > thread appears.
    > I did like to know if there is a way I can track and find out where
    > this thread is starting from ?


    It's starting from the constructor of a java.util.Timer. You can see
    where that is by putting a breakpoint on it.

    You can stop the thread by calling cancel on the timer. If you must, you
    can construct the timer with isDaemon flag set.

    Tom Hawtin
    --
    Unemployed English Java programmer
    http://jroller.com/page/tackline/
    Thomas Hawtin, Sep 18, 2006
    #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. Lloyd Sheen

    Die IDE Die

    Lloyd Sheen, Jan 24, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    427
    Natty Gur
    Jan 26, 2004
  2. Lloyd Sheen

    More Die IDE Die

    Lloyd Sheen, Jan 24, 2004, in forum: ASP .Net
    Replies:
    5
    Views:
    443
    Alvin Bruney
    Jan 25, 2004
  3. Replies:
    1
    Views:
    1,602
    Steve C. Orr [MVP, MCSD]
    Feb 22, 2005
  4. John Benson
    Replies:
    1
    Views:
    345
    Hoang
    Jan 15, 2004
  5. Replies:
    3
    Views:
    95
    Paul Lalli
    Nov 17, 2006
Loading...

Share This Page