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

finding non-daemon threads

 
Bobby Anderson
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I am currently having a problem with java.exe processes hanging around after my swing app has been closed. I assume that I have some non-daemon threads hanging around that are preventing my app from shuting down.

What is the best way to debug this? I.E. hwo do I tell what threads are hanging around and maybe where they were created?

Thanks!
Billy
 
Rob Spoor
Sheriff
Posts: 20822
68
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The easiest way needs just one line:

By default, when you "close" the frame it is merely hidden, and the event dispatcher thread keeps on running. With the above call you are telling the JVM to exit when the frame is closed.
 
Bobby Anderson
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes I can try that but that was not really my question.

When I see a java.exe process hanging around can I get a stack trace on it or something to try and figure out where is started and why it is still hanging around.

I.E. i want to be able to debug these types of problems on my own not post a new thread everytime i run into a problem.

Thanks

Billy
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Unlike javaw.exe, the java.exe has an associated console window which should be displaying the stack trace under normal circumstances.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!