Whether the daemon thread will be GCed if it comes out the run method provided the main thread keep on running?
posted 12 years ago
Yes. Well as usualy, there are no guarantees regarding GC, and if you have saved a reference to the thread somewhere, you certainly my prevent GC. But in general, once a thread completes its run method it will be eligible for GC (unless there are other references somewhere). Being a daemon thread does not change this.