Java multi-threading - what is the best way to monitor the activity of a number of threads?

Posted by MalcomTucker on Stack Overflow See other posts from Stack Overflow or by MalcomTucker
Published on 2010-03-13T09:20:50Z Indexed on 2010/03/13 9:25 UTC
Read the original article Hit count: 292

Filed under:
|

I have a number of threads that are performing a long runing task. These threads themselves have child threads that do further subdivisions of work. What is the best way for me to track the following:

  • How many total threads my process has created
  • What the state of each thread currently is
  • What part of my process each thread has currently got to

I want to do it in as efficient a way as possible and once threads finish, I don't want any references to them hanging around becasuse I need to be freeing up memory as early as possible.

Any advice?

© Stack Overflow or respective owner

Related posts about java

Related posts about multithreading