Question on memory management in android

by Anton S. » Wed, 05 Jan 2011 03:01:52 GMT

Sponsored Links
I have a single image that is slightly larger than the android screen
which I load into a ScrollView.

My question is the following:

Does android load the entire image into memory even though parts of it
are invisible(need to be scrolled to),
or does it use some kind of external/internal cache to store parts of
the image that are not
currently visible? If not, do you think it would be possible to
implement something like this.



Re: Question on memory management in android

by Doug » Thu, 06 Jan 2011 08:51:12 GMT

 Bitmaps are going to take as much memory as they need for the grid of
pixels they represent.  If you want to store a giant image into a
giant bitmap (or even if you just want to create a giant empty bitmap)
you will consume that memory.

Android doesn't do so well with giant bitmaps that come and go because
they don't get garbage collected in the way you'd expect, and you'll
often run into memory problems if you attempt this.  It's a really
hairy topic with a lot of prior conversation around it that you can
easily search and find.



Sponsored Links

Re: Re: Question on memory management in android

by Anton S » Fri, 07 Jan 2011 02:32:30 GMT

 Alright, so that means it does load the entire image into memory.

I guess I'll try to break up my image and only load parts of it as they are

Thanks for you input Doug!


Other Threads

1. LocationManager requestLocationUpdates and pending intents

Hi all, in order to save some battery, I was wondering what happens if
an activity registers a requestLocationUpdates and then the user (or
the os) puts it in background or kills it. Will the location manger
still be active and then will the pending intent still be fired?
In other words, will the location manager still be alive even if its
lancher does not exist anymore?
I'd really love this scenario because allows me to link an intent
service that handles the location updates without bothering of have
something always running waiting for good news from location.

Hope I am not too confused :-)

Thanks in advance,



2. Android di Metro

Lagi di metro tivi


@pahlawan putih

"Indonesian Android Community [id-android]" 

3. java issues in mac and window

4. Possible to display a string or button on top a listview?

5. HTTP Multipart POST: data + text

6. Testing C2DM service on Android 2.2 emulator

7. Call Blocking through ndk or latest sdk