public static void runFinalizersOnExit(boolean value)Deprecated. 
This method is inherently unsafe. It may result in finalizers being called on live objects while other threads are concurrently manipulating those objects, resulting in erratic behavior or deadlock. 这个函数有问题,sun不建议用这个方法。

解决方案 »

  1.   

    你使用了被sun deprecated的方法runFinalizersOnExit(true),这种deprecated的api方法现在不赞成你使用,因为他们都有了替代的方法,之所以保留他们是为了和原来编写的程序保持兼容。
      

  2.   

    sun不推荐手动去gc()的,那样做其实并不能达到你预期的效果。警告而已,你要强硬的用也可以,怕生命期不长。那些方法可能慢慢的消失掉。
    保留是一个过渡期。