Android heap size and SoftReferences -


i have application creates series of bitmaps. holding these bitmaps in softreferences, avoid running out of memory. heap size grow maximum 16mbs before starts collecting softreferences. however, softreferences collected eagerly, prior growing heap it's max. there anyway force references collected less eagerly? or manually grow heap max? possibly way start application 16mb allocated?

there no way modify softreference collection behavior.

i'm not sure mean "manually growing heap max".

if these instances of bitmap class (as opposed custom bitmap implementation), pixel data stored on native heap, uses annoying "external allocation" accounting trick, complicates situation further. (notably, storage freed finalizer, not gc, , finalizers have execute in separate thread after gc completes. it's possible allocate bitmaps until run out of memory, , gc has no way release memory before throwing oom error.)


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -