memory management - Android: Bitmaps, SoftReferences, and OOMs? -


i have series of views in vertical linearlayout. each view generates , draws bitmap, when scrolled to. performance reasons, rather not generate bitmap each time ondraw() called, memory reasons can not keep hard references bitmaps. use advice on strategy should take.

i tried obvious route of: generating bitmap, , wrapping softreference. failed 2 reasons. 1. references collected far more eagerly expect. 2. still ooms! shocking, because no bitmap particularly large, single view should not cause oom, making me assume oom occurs because offending softreference(s) had not been given chance freed. also, oom occurs when application has allocated heap size of 6mb (according ddms view), expect grow 16mb before throwing oom.

any advice?

the problem bitmaps use finalizers, therefore, might take couple of gc passes before native memory released. working on making better.


Comments

Popular posts from this blog

Add email recipient to all new Trac tickets -

400 Bad Request on Apache/PHP AddHandler wrapper -

php - Change action and image src url's with jQuery -