最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Can android app crash lead to memory leak? - Stack Overflow

programmeradmin0浏览0评论

Can android app crash lead to memory leak?

AFAIK - activity and services and receivers and content-providers of an app are processes. When the app crashes (eg NoSuchElementException), processes of all these components of the app also die. Then the garbage collection takes care of memory - ie it takes back all the memory used for the system. Hence there should be no memory leaks - but I just wanted to confirm.

Can android app crash lead to memory leak?

AFAIK - activity and services and receivers and content-providers of an app are processes. When the app crashes (eg NoSuchElementException), processes of all these components of the app also die. Then the garbage collection takes care of memory - ie it takes back all the memory used for the system. Hence there should be no memory leaks - but I just wanted to confirm.

Share Improve this question asked Mar 28 at 17:23 Rishabh GuptaRishabh Gupta 8241 gold badge7 silver badges13 bronze badges
Add a comment  | 

2 Answers 2

Reset to default 2

When your app crashes, the process is terminated. That means all resources allocated to the process are returned to the OS. So no, it can't cause a memory leak, unless there's an OS level bug in the memory allocator. Which on Linux (the base OS of Android) would be incredibly unlikely.

The garbage collection operation carrier of the art virtual machine is your application process itself.

If the application process crashes, the resource recovery operation is guaranteed by the Android system.

发布评论

评论列表(0)

  1. 暂无评论