Customer has created a new class that will run in it's own Thread. He has done this by extending the Thread class instead of by implementing the runnable interface.
Instances of this class are then used to handle client requests and the application determines whether to call the instances start() method which will have the connection handled in a seperate Thread or the instances run() method which will have the connection handled in the current Thread.
Using the second method, the instance is never gc'd even when completely dereferenced by the code that called it. This is due to the fact that the Threading system has a reference to the instance held as an element of a ThreadGroup. This reference is not lost until the Thread is started and then stopped.
Instances of this class are then used to handle client requests and the application determines whether to call the instances start() method which will have the connection handled in a seperate Thread or the instances run() method which will have the connection handled in the current Thread.
Using the second method, the instance is never gc'd even when completely dereferenced by the code that called it. This is due to the fact that the Threading system has a reference to the instance held as an element of a ThreadGroup. This reference is not lost until the Thread is started and then stopped.
- duplicates
-
JDK-4197876 If start method is never called on a thread, that thread is leaked
- Closed