将呼叫从活动结束()释放我的记忆空间? [英] Will calling finish() from an activity free up my memory space?

查看:116
本文介绍了将呼叫从活动结束()释放我的记忆空间?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用大量的内存在我的应用程序的活动。因此,当用户从活动到其他活动切换,我想调用finish()停止该活动。

I have an activity which uses considerable amount of memory in my app. So whenever the user switches over from that activity to some other activity, I am trying to call finish() to stop that activity.

我的问题是,将调用从活动结束()释放内存空间,或者只是完成该活动没有清理由特定活动使用的内存?

My question is, will calling finish() from that activity free up memory space or just finishes that activity without cleaning the memory used by that particular activity?

任何帮助很多AP preciated ..

Any help is much appreciated..

推荐答案

你打电话从被破坏,它的所有资源都排队的完成()法活动垃圾收集,因为这一活动的引用将无法访问。所以,过去曾通过本次活动的所有内存将在明年GC周期被释放。

The activity you're calling the finish() method from is destroyed and all its resources are queued for garbage collection, because a reference to this activity becomes inaccessible. So, all memory that was used by this activity will be freed during next GC cycle.

这篇关于将呼叫从活动结束()释放我的记忆空间?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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