Memory Leaks in Android application

后端 未结 1 1288
失恋的感觉
失恋的感觉 2021-02-01 05:32

I\'m experience some memory leaks in my application. The first time I suspected the memory leak was when I stress-tested my application by hitting a button to start a new

相关标签:
1条回答
  • 2021-02-01 05:55

    Do you use static variables to cache big resources?
    If yes then that's a common mistake in Android apps to use activity context to load such resources. This leads to sustain activities and all their resources even though they are not needed any more.
    To fix this use application context to load such resources!

    You can refer to this Android developers blog post for more details.

    0 讨论(0)
提交回复
热议问题