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 ?
Asked
Active
Viewed 287 times
1 Answers
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.