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. Hero ROM based official WWE HTC

berhubung lagi gak ada kerjaan. dan pengen mendalami belajar android. ini
custom ROM pertama based pada official Hero WWE. masih banyak kekurangan
sepertinya. dan malem ini atau besok saya akan update lagi.

    * tweaking memory dengan setingan MemFree manager
    * Wireless Tether
    * Official Eclair 2.1
    * ChainsDD Superuser 2.1
    * 3D Gallery
    * STK
    * init.d folder support
    * Automatic Apps2SD
    * AdFree
    * No Boot Sounds

sory belum sempet ngecek hash MD5nya. silakan yang mau coba,
menyusul overclock kernelnya ntar di link ya..
dalam bentuk update zip.


menyusul previewnya jg.. HHnya lagi dipake

Indosat Broadband + Heroic Android

im team
Android Library Forum

"Indonesian Android Community [id-android]" 

2. Android Mp3 Intent: Shazam does it, how do we?

Is this a private Intent now or what? This used to work. I debugged
and found amazon changed the package name. All good, but now you can't
launch the Search Activity directly (permission denied)

So, here's what Shazam is doing,b ut I can't quite figure out how they
are adding extra's or something to the intent to get it to proxy and
then load the search?

So, I can call the EXTERNAL_EVENT, and this will load a blank Amazon
MP3 app...(or I can call  HomeActivty and that just loads the app, but
I'd like to put a search artist in there).


(Btw, is Google censoring/deleting questions regarding this App? I've
posted another one and it is now removed).

You'd think Amazon would want us who are writing music apps to direct
our users to them...

/WindowManager( 2264): Dsptch 1 x166.0 y570.0 > Window{47b52780 paused=false}
I/ActivityManager( 2264): Starting activity: Intent
{ (has extras) }
D/PhoneWindow(11982): couldn't save which view has focus because the
focused view has no id.
D/dalvikvm(11982): threadid=39 wakeup: interrupted
I/ActivityManager( 2264): Start proc for activity pid=12022
uid=10029 gids={3003, 1015}
W/InputManagerService( 2264): Window already focused, ignoring focus
gain of:$Stub
I/Zygote  (12022): Zygote: pid 12022 has INTERNET permission, then set
capability for CAP_NET_RAW(13)
I/dalvikvm(12022): De{*filter*} thread not active, ignoring DDM send
(t=0x41504e4d l=38)
I/dalvikvm(12022): De{*filter*} thread not active, ignoring DDM send
(t=0x41504e4d l=32)
I/ActivityThread(12022): Publishing provider
V/WifiProgressStore(12022): WifiProgressStore Created
D/Configuration(12022): active site = local
I/System.out(12022): interface name: null
D/dalvikvm(12022): GC freed 3204 objects / 285096 bytes in 184ms
I/ActivityManager( 2264): Starting activity: Intent
{ act=android.intent.action.SEARCH flg=0x14000000 (has extras) }


3. Solution to whining users over advertising

4. Android-based Laptop + need to run Win XP apps

5. WTPamer: Homescreen hari ini

6. Homescreen g

7. Link belajar desire