开发者

How to manage memory/cache from code?

开发者 https://www.devze.com 2023-02-18 10:05 出处:网络
My app is crashing after longer use - runs开发者_如何学运维 out of memory. I am closing all activities after switching to next one, but I still have that problem.

My app is crashing after longer use - runs开发者_如何学运维 out of memory. I am closing all activities after switching to next one, but I still have that problem.

Is it possible to programmatically clear cache / memory, so application does not run out resources? Can I use getCacheDir() to accomplish that?


Apparently your app is leaking memory. Make sure you clean up unused resources, close databases, reuse variables, etc.

Also refer to this post on how to track down memory leaks and how to avoid them.

0

精彩评论

暂无评论...
验证码 换一张
取 消