foxtrotzulu94 / ECE-Pokedex

An Android App for those that want to be the very best! You Gotta Catch 'Em All!
MIT License
1 stars 1 forks source link

Investigate Heap OOM Issue #9

Closed foxtrotzulu94 closed 9 years ago

foxtrotzulu94 commented 9 years ago

Device: Genymotion Emulated Nexus 5, Android API 19 (1080x1920) Branch: issue-#3-UI Build Settings:

When running on a Genymotion Device, the Dalvik VM Heap is constantly at 99% allocation. This causes the application to crash when turning to landscape mode at any arbitrary point due to an OutOfMemory error. Investigate the cause of this issue to see whether it is Genymotion specific or related to an optimizable feature in the application. If it is Genymotion specific, no further action is needed.

foxtrotzulu94 commented 9 years ago

@thineshth, I've tracked down the issue to a Color Depth problem. Android is trying to load in Deep Color (36bits per pixel). For now, I'll merge #10 to master and let you try out the fix below. The issue should be gone as soon as Android starts loading with 8 bits per color (Or maybe even less). Check out the links below

http://stackoverflow.com/questions/21050649/color-depth-in-android (Bitmap manipulation)

http://www.curious-creature.com/2010/12/08/bitmap-quality-banding-and-dithering/

foxtrotzulu94 commented 9 years ago

I've just incorporated some optimizations into master. Let me know when you can how it runs on your phone.

thineshth commented 9 years ago

Issue fixed thanks to the bitmap optimizations. Works silky smooth like butter.