How can I actually, really deallocate a Thread to release the memory? Setting thread = null does not work!
- Make sure that the thread's start() method has been called.
- Make sure that the thread has stopped executing.
- Clear any references to that Thread object (thread = null;).
This is the best you can do to ensure the release of memory for a Thread. You have to call start() on the thread because several JVMs have a bug where they will not release all the thread's memory if the thread is not started.