• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Thread Dumps Without Killing the thread

 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey All

I have a qucik question about taking thread dumps using KILL -3 PID command. I know that this command generates a thread dump for the given process ID. But why do we have to kill it ? Does Kill-3 actually kill the process or just generate a dump file?/

Thanks!
Sid
 
Sheriff
Posts: 5555
326
IntelliJ IDE Python Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
kill -3 does not kill the process.
 
Sid varma
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well I thought KILL would terminate the process. But I guess only Kill -9 will truly terminate it, while kill -3 just produces a thread dump

Thanks Cooke !
Sid
 
Ranch Hand
Posts: 376
2
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Sid varma wrote:Well I thought KILL would terminate the process. But I guess only Kill -9 will truly terminate it, while kill -3 just produces a thread dump

Thanks Cooke !
Sid



Correct. -3 is for taking thread dumps.
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Another possibility is to use WLST. This way you can let the dumps be written to a separate file.
call "java weblogic.WLST"

see complete Docu: http://docs.oracle.com/cd/E13222_01/wls/docs92/config_scripting/reference.html#wp1104314
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Java contains a jstack utility which you can use to get the thread dumps http://docs.oracle.com/javase/7/docs/technotes/tools/share/jstack.html



You can even redirect the output to a file:


It doesn't kill/stop the process.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic