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 / August 2007

Tip: Looking for answers? Try searching our database.

Kill Thread Within Java.exe Process

Thread view: 
John A. Bailo - 03 Aug 2007 01:23 GMT
I am monitoring a java application (running as a Windows service) from
a third party.

psinfo shows me all threads, and I noticed there were two that have
been running over 9 hours.    It was about 9 hours ago that CPU
utilization on my Windows 2000 Server went up to 50%.

I know I use pskill to stop the entire java.exe -- but is there an
external command or program I can write to kill an individual thread
inside a java.exe ?
Daniel Pitts - 03 Aug 2007 02:03 GMT
> I am monitoring a java application (running as a Windows service) from
> a third party.
[quoted text clipped - 6 lines]
> external command or program I can write to kill an individual thread
> inside a java.exe ?

No. You'll have stop the entire Java proces and start it again.
Eric Sosman - 03 Aug 2007 03:14 GMT
> I am monitoring a java application (running as a Windows service) from
> a third party.
[quoted text clipped - 6 lines]
> external command or program I can write to kill an individual thread
> inside a java.exe ?

    Not unless you've arranged a way for the threads to stop
on (or shortly after) some external stimulus.

    See the Javadoc for Thread#stop() to understand why this
cannot even be done safely from inside the Java program, much
less from the outside.

Signature

Eric Sosman
esosman@ieee-dot-org.invalid

Mike Schilling - 03 Aug 2007 07:11 GMT
>> I am monitoring a java application (running as a Windows service)
>> from a third party.
[quoted text clipped - 9 lines]
>     Not unless you've arranged a way for the threads to stop
> on (or shortly after) some external stimulus.

One way of doing this to to run the JVM as debuggable.  That lets you attach
a debugger later, examine the threads, and kill whichever ones you like.

>     See the Javadoc for Thread#stop() to understand why this
> cannot even be done safely from inside the Java program, much
> less from the outside.

That's true, of course.


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



©2009 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.