0

In my Java app I'm using ExecutorService to start and shutdown threads, but when the app is done, some threads are still running, so I used Netbeans[8] profiler to see why so I can terminate them, but as you can see from the attached chart, there are lots of them still running and I don't know where in my app these threads started, I double clicked and right clicked on the threads, nothing happened, I guess there must be a way to get to my code from the chart, can someone tell me how ?

enter image description here

1 Answer 1

1

Many implementations of ExecutorService manage a thread pool. Your instance has several threads in the WAITING state, perhaps as a result of invoking LockSupport.park(). The API illustrates a common shutdown approach, which you can tailor to your use.

Addendum: As a concrete example, this WorkerLatchTest creates a pool of N = 8 worker threads. Double click on a thread in the timeline to see details about the thread.

image

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.