java - How does Memory management work in Android? I'm getting a lot of out of memory exceptions -


this question has answer here:

i’m learning java learn how program in android. under impression java handles memory management you, not seem true. small apps ran fine, i’m working on puzzle app toddlers has lot of graphics. i’ve been getting lot of out of memory exceptions after app runs while. runs fine, solved issue setting bitmap pointers null when i’m done them. @ end of each service, set bitmap objects null , working.

it works, don't understand if i’m supposed free pointers in java?

setting bitmap null allow garbage collector run , clean (you can speed process calling recycle first). if don't need image, best otherwise holding onto lots of large images use memory allowed app run (android doesn't give whole lot).

if image goes out of scope happen automatically (but again calling recycle speed process along), if have lot of global static images hold on lot of images, when trouble.


Comments

Popular posts from this blog

matlab - Deleting rows with specific rules -

jquery - How would i go about shortening this code? And to cancel the previous click on click of new section? -