Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / September 2006

Tip: Looking for answers? Try searching our database.

Mysteriously appearing Timer thread does not allow JVM to die

Thread view: 
cprakash@gmail.com - 18 Sep 2006 09:01 GMT
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
Thomas Hawtin - 18 Sep 2006 14:37 GMT
> Hi All,
> In my application, a "Timer-1" thread seems to appear out of nowhere
[quoted text clipped - 5 lines]
> 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
Signature

Unemployed English Java programmer
http://jroller.com/page/tackline/



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.