Skip to content
This repository has been archived by the owner on Feb 22, 2022. It is now read-only.

Support a fail-safe strategy when OOM happens #25

Closed
openaphid opened this issue Dec 12, 2012 · 5 comments
Closed

Support a fail-safe strategy when OOM happens #25

openaphid opened this issue Dec 12, 2012 · 5 comments

Comments

@openaphid
Copy link
Owner

eg, to use a default texture if FlipView failed to capture screenshots caused by OOM errors

@ghost ghost assigned openaphid Dec 14, 2012
@VAdaihiep
Copy link

Hi openaphid,
Please fix this priority, OOM error often happen when i flip many times.
Thank you.

@sandeeptiwari
Copy link

Hi openaphid,
Please fix this issue, I also face this issue in may app,OOM error often happen when i flip many times.
Thank you.

@VAdaihiep
Copy link

As I told, the reason is NOT capture screenshot because it already recycled.
I just know that the reason is: Each call getView(), one instance of convertView is allocated in memory so: flip -> getView() -> create new convertView -> ... -> OOM.

Solution 1: change FlipViewController to use: getViewTypeCount() and getItemViewType() like ListView (more info here http://android.amberfog.com/?p=296)

Solution 2: change YourAdapter to cache some View with different type and reuse View when item have same type.
I'm using solution 2 and when i show log heap size to check the memory, the result is good. And since I used this solution, I have never encountered an OOM error.

Pls try and hope it will help you.

@openaphid
Copy link
Owner Author

Please refer to #33

@openaphid
Copy link
Owner Author

Lower the priority of this issue since the memory leak is caused by incorrect handling of adapter in FlipView

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants