Hello,
I am working on reducing the memory usage of my application, and it looks 
like one of the part that consumes a lot of it is the application Resources 
class that gives access to all my drawable pngs. I didn't find a lot of 
documentation on how it deals with memory, but it looks like it loads the 
png that are in my res/drawable/* folders when they are needed, and they 
are actually never released from memory.
I have a couple questions about this:
 - Is this really what happens?
 - Are all screen density images loaded, or just the one adapted for my 
device?
 - Where kind I find more info about this?

I have a bunch of pngs that are only being used once (Splash screen 
background, onboarding screens, etc...), but running the Eclipse MAT, it 
looks like they're never released from the Resources.
 - Is there a way to unload them from the memory once they're not needed 
anymore?
 - It looks like there is a method for flushing the Resources 
(http://developer.android.com/reference/android/content/res/Resources.html#flushLayoutCache()),
 
but according to the doc it should only be used for tracking performances. 
Is it unsafe to use in my context?
 - Should I just not put large images in my res/drawable folder and decode 
them manually from the disk so that they don't get stored in Resources at 
all? If yes, where is a good place to store this kind of files?

Thanks!

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to