btw the in-memory size is much bigger than the size of the file. that 4k is the jpeg-compressed file size, in memory it would be 100x100x4 (32-bit colour) = 40k at least.

but i would think you should be able to hold 10x 40k without any problems, so maybe something else is sucking a lot of memory.



Thanks Jason-

In my case the application needs to show all 12 images at the same
size.  I could switch to a listview but that will degrade the user
experience.

I have also been thinking about switching to a webview that loads a
static HTML page containing all 12 thumbnails.  Seems silly, but if I
can't beat my memory issues the I'll use it as a last resort.

I checked out the thumbnails, they're already sized to 100x100 jpgs of
roughly 4k in size, seems like I should be able to hold them in memory
4x12 = 48k, so there must be something else going on.


On Feb 3, 12:37 pm, Jason Proctor <[email protected]>
wrote:
 do all the thumbnails have to be on the screen at once? if not,
 consider keeping the images as their compressed equivalents (JPEG
 byte arrays, etc), then use a ListView as it will recycle views
 that's not currently visible, allowing you to inflate JPEGs into
 Bitmaps and then throw the Bitmaps away appropriately.

 i have ListViews which have thumbnails, and i use this scheme with no
 memory problems at all.

 ...and whether you have to display them all at once or not, consider
 using BitmapFactory decoding options to resample the images to a
 better size. maybe the images coming in are much bigger than the
 thumbnail view needs them to be?

 hth

 >My application loads 12 100x100 thumbnail images from the web using
 >the code below.  I then display the thumbnails in a GridView using an
 >ImageAdapter derived from BaseAdapter.  I'm running into memory issues
 >because each of the thumbnails is held in memory as a Bitmap.

 >This seems like a fairly straightforward application (display a
 >gallery of thumbnails from the web), can some give me advice on how to
 >reduce my memory needs?  Maybe there's a better way to display web
 >images in a GridView that doesn't involve downloading and storing each
 >one as a Bitmap?

 --
 jason.vp.engineering.particle

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


--
jason.vp.engineering.particle

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to