解决方案 »

  1.   

    把线程 置为 null  GC 就可以回收了。
      

  2.   

    线程在结束之后如果不用会被自动销毁;
    或者可以看看Executor
      

  3.   

    为啥要自行销毁? run() 函数执行完,线程就没了。如果只是线程对象所占的那点内存,跟对象释放是一样的 = null 就等着GC回收了。
    最后建议是:你的场景用线程池更合适,让线程池自己去管理,你只管往里面增加任务就好了。
      

  4.   

    线程运行完毕会自动销毁啊。我的job,一天会生成500个线程,都是自己销毁的。你的问题可能不在线程这里,要么就是线程中打开了文件,连接了数据库而没有释放资源导致的
      

  5.   

    +1
    线程对象也是new出来的,GC可以回收,线程池可以指定最大线程数
      

  6.   

    All threads that are not daemon threads have died, either by returning from the call to the run method or by throwing an exception that propagates beyond the run method. 以上是api的说明。
      

  7.   

    5楼正解 
    run完之后 会自动 销毁
    可以看看线程的机制