System.gc()与System.runFinalization()的区别?

IgirlT 2004-05-03 06:38:01
请教,关于如下两个方法的区别:
System.gc();
System.runFinalization();

...全文
168 8 点赞 打赏 收藏 举报
写回复
8 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
BigBangBug 2004-05-06
严重同意midlet(midlet)!!1
  • 打赏
  • 举报
回复
rainboy20024 2004-05-06
gz
  • 打赏
  • 举报
回复
overawe 2004-05-06
第一个不是手动调用垃圾回收器吗
第二个不太清楚 好相是调用在垃圾回收之前必须调用的那个东东吧
我觉的最好自己都别手工调用
  • 打赏
  • 举报
回复
midlet 2004-05-04
i think your question is about the difference between garbage collection and finalization.

Simply speaking, garbage collection is just to RECLAIM the MEMORY occupied by unused object, and it is only about the memory. However finialization is to clean up an object. It means that if there is some activity that must be performed before you no longer need an object, you must perform that activity yourself (quite possibly in your finalize method). ( While it is not same as the destructor in C++). Finalize is not used much.
  • 打赏
  • 举报
回复
dogcai 2004-05-04
学习
  • 打赏
  • 举报
回复
NEW1981 2004-05-04
System.runFinalization()建议不被使用,会造成不稳定

  • 打赏
  • 举报
回复
IgirlT 2004-05-04
撤消什么啊?
  • 打赏
  • 举报
回复
xinshou1979330 2004-05-03
第二个是不是一个撤消的方法呢?
学习

现在对JAVA的基础特感兴趣(招聘单位都注重基础哦)
  • 打赏
  • 举报
回复
相关推荐
发帖
Java SE
加入

6.2w+

社区成员

Java 2 Standard Edition
申请成为版主
帖子事件
创建了帖子
2004-05-03 06:38
社区公告
暂无公告