• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Live wallpaper memory leaks

I am making live wallpapers which use around 40 bitmaps decoded from jpegs each of size approx 150KB. But when i install and run the live wallpaper, the application manager in my phone (Galaxy S4) shows its memory usage more than 90 MB. Looking at all memory allocations in my program i dont see it should go above 20MB. I dont know where all this memory is getting consumed.

Same case with another live wallpaper which is using only 7 bitmaps same size and memory usage is 110 MB and it runs very slowly.

Does anyone know why does a live wallpaper consume so much runtime memory?
 
Can you post the code you use to load the bitmaps?

Also what size pixel-wise are those images? JPG is a compressed format, and you won't store the jpegs in memory at runtime, but rather the decoded bitmaps. The bitmaps themselves are not compressed and have the 4 following format choices: Bitmap.Config | Android Developers

The default is ARGB_8888 which means 4 bytes per pixel. If the image is big, it can easily go to 3+ MB size per image.
 
Yup, with images that size, bitmaps will use almost 8 MB per image. It's not really a memory leak though, it's working as intended.
 
hi mister !
i am here not to help you but to seek your help !
please pardon my comment, but i am really stuck as i want to make a live wallpaper which the idea is likely identical to yours. But i am an image editor and a digital artist and i am no programmer (all these scripts make me sick :p)
so if only you could enlighten me a little,
my idea is to separate a video "witch i made before" to a certain number of images, and use it to generate a live wallpaper, the problem is, i don't even know where to start and which program to use....
please forgive my curiosity, but i promise if you could help, i'ill have you name mentioned on the on the "special thanks area "

thank you !

here is the link to the vid
https://www.youtube.com/watch?v=32_B-7pG07c&feature=youtu.be
 
Back
Top Bottom