question

jacquesgiraudel avatar image
jacquesgiraudel asked

Using LRUCache (android support implementation) on a Kindle

Hello, I have observed differences of heap impact using the LRUCache on an emulator and on a Kindle Fire HD. On the emulator, adding an image (argb) to the cache seems to cost width * height * 4 bytes (observation made with the ddms heap visualizator tool), on the Kindle Fire HD it seems to be less. For a reference image of 1280 * 800, it costs 3.9Mb on the emulator and only some kb on the Kindle. Can you explain this difference ? Is the image stored in Video RAM ? Do you use some kind of compression for the Bitmap object ? Thank you for your answer Jacques
fire tablet
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

jacquesgiraudel avatar image
jacquesgiraudel answered
As an additional comment, it seems that it not uses native memory.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

jacquesgiraudel avatar image
jacquesgiraudel answered
Additional question : if the Bitmaps are effectively stored in VRAM, can you please indicate me what is the available VRAM amount by device ? Thank you
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

jacquesgiraudel avatar image
jacquesgiraudel answered
+1
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

DougM@Amazon avatar image
DougM@Amazon answered
Hello Jacques, As you most likely are aware, the LruCache implementation as built into the Android Support library is static. Meaning that if you include the Android Support Library in your project that any behaviors that are observed are not an artifact of our implementation on the LruCache class but of Google's implementation that they have baked into the support library. For more information, it is discussed in the class overview at : http://developer.android.com/reference/android/support/v4/util/LruCache.html
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.