System.gc和System.runFinalization区别
http://www.drovik.com/ 2013-3-22 10:15:59 来源:www.drovik.com 点击:
System.gc();
//告诉垃圾收集器打算进行垃圾收集,而垃圾收集器进不进行收集是不确定的
System.runFinalization();
//强制调用已经失去引用的对象的finalize方法
System.gc(); hints the VM that it is probably time to activate the Thread doing to the Garbage Collection. So all the part of this sentence stands in the hint word. The finalizer are run according to the VM good will, generally speaking. This means they could be run or could not. Invoking the System.runFinalization( ); force the VM to invoke on each instance the finalizer when it Garbage collects the Object referenced
//告诉垃圾收集器打算进行垃圾收集,而垃圾收集器进不进行收集是不确定的
System.runFinalization();
//强制调用已经失去引用的对象的finalize方法
System.gc(); hints the VM that it is probably time to activate the Thread doing to the Garbage Collection. So all the part of this sentence stands in the hint word. The finalizer are run according to the VM good will, generally speaking. This means they could be run or could not. Invoking the System.runFinalization( ); force the VM to invoke on each instance the finalizer when it Garbage collects the Object referenced
- 相关文章
- android ndk抛出 signal 11 (SIGSEGV), code (29人浏览)
- Android NDK调用时Java 的类型与虚拟机中的表示对照表 (18人浏览)
- Android Application对象必须掌握的七点 (2人浏览)
- 不同Android版本之间旋转屏幕时禁止重新加载Activity的区别 (3人浏览)
- 手把手教你轻松解决Android模拟器无法上网的问题 (48人浏览)
- Android 4.1 Audio系统变化说明 (4人浏览)
- android StaticLayout参数解释 (53人浏览)
发表评论(0)