Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Thread Dumps

 
srinivasan ganesan
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does anyone know how to create thread dumps from a java program? This program will call another program that creates some threads and attempt to do a thread dump except I'm not sure how to do it.

Any help would be appreciated.

Thanks,
Srini
 
Jose Botella
Ranch Hand
Posts: 2120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To see the stack: Thread.dumpStack()

However it prints the current stack trace. Thus it should be called from the code you want to see the stack trace.
[ May 23, 2004: Message edited by: Jose Botella ]
 
raimondas zemaitis
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
there is no way you can do that programmatically. In windows, activate console that Java app is running and hit Ctrl+Break. That will get Threads dumped to the screen. Very convienent for deadlock debugging.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!