If you scrolled through a list quickly, and each one is loading its own default asset, you could create a burst of memory usage that runs you out of memory. This problem hit us because we had an ImageView in a list show a default asset before we load an image from the network. If you're decoding the same resource over and over again, you might want to cache it. When you're decoding resources yourself (rather than using something like tImageResource()), there are a couple things to look out for. When we couldn't lower the resolution without quality suffering greatly, we would sometimes replace the normal asset with a backup color (when we detected low memory situations). Some of these backgrounds were blurred, meaning we could lower the resolution greatly without losing quality. We solved this problem one of two ways: first, we reduced the resolution of the asset. That's fine with the N10's beefy heap size, but when scaled down to smaller devices (like the N7) the scaled image would take up 1/8th of the app's memory! Imagine doing that multiple times and you can see why we ran into memory issues.
#Eclipse memory monitor bitmap full#
For example, we had tablet backgrounds which were the full resolution of the N10 (2560x1600). This can cause serious issues if you have high-resolution assets. High-Resolution Bitmapsīitmaps in memory are uncompressed (even if they were compressed in your APK). This makes it much harder to debug memory problems on 2.x devices, so you might want to stick to 4.x devices for investigating memory issues.
#Eclipse memory monitor bitmap android#
In versions of Android previous to 3.x, Bitmaps were stored in native memory (rather than the heap) and thus not viewable in MAT. Not only is it useful for finding out what's hogging memory, it can also be used to find memory leaks.Īn important note about using MAT - almost all memory problems I've run into relate to Bitmaps. MAT should be your first stop for dealing with memory problems. If you're not familiar with Eclipse's MAT you should be. I thought I'd share some details about the problems we ran into and how we solved them. During the development of the most recent version of Expedia's Android app we ran into a variety of memory problems.