在Android的垃圾收集(手动完成) [英] Garbage Collection in android (Done manually)

查看:165
本文介绍了在Android的垃圾收集(手动完成)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个奇怪的疑虑。我知道垃圾收集器有其自身的局限性。并且在分配
坏那么它可能会导致一个问题,在应用不同寻常的方式作出回应。

I have a strange doubts. I know garbage collector has its own limitation. and if allocation is bad then it can cause a problem for application to respond in unusual way.

所以我的问题是,它是很好的编程习惯强行调用垃圾收集器(的System.gc())在每项活动结束了吗?

So my question is that is it good programming habit to call forcefully garbage collector (System.gc()) at the end of each activity?

更新

每个人是说,调用System.gc()在all.Then不利于我想知道为什么它的present here.DVM将决定何时运行垃圾collector.Then什么是需要的方法?

Every one is saying that calling system.gc() not beneficial at all.Then i am wondering why its present here.DVM will decide when to run garbage collector.Then what is need of that method?

更新2

感谢社区帮助我。但老实说,我得到了有关垃圾回收的实际波伏瓦的知识从这个链接<一个href=\"http://www.javaworld.com/javaworld/jw-10-2012/121010-jvm-performance-optimization-garbage-collection.html\"相对=nofollow> Java性能优化

Thanks community to help me out. But honestly i got knowledge about Garbage collection real Beauvoir from this link Java Performance Optimization

推荐答案

它的不是良好的编程习惯强行调用垃圾收集函数(System.gc())在每项活动结束

it isn't good programming habit to call forcefully garbage collector (System.gc()) at the end of each activity

由于它是无用的,只有DVM决定什么时候应该叫虽然你把它叫做...

Because it is useless,only DVM decide when it should be call although you called it...

这篇关于在Android的垃圾收集(手动完成)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆