On Aug 27, 10:54 pm, Ramesh <[email protected]> wrote: > 08-28 11:16:26.785: ERROR/AndroidRuntime(1433): Uncaught handler: > thread main exiting due to uncaught exception > 08-28 11:16:26.825: ERROR/AndroidRuntime(1433): > java.lang.OutOfMemoryError: bitmap size exceeds VM budget > 08-28 11:16:26.825: ERROR/AndroidRuntime(1433): at > android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
If you are creating a lot of big bitmaps from compressed data (e.g. PNGs or JPEGs), you should look at the new BitmapFactory.Options.inPurgeable flag in Donut. This allows the native-heap memory to be managed by ashmem, which means it won't be "charged against" your 16MB java heap. The price you pay is that the pixel buffer may be ejected during low-memory conditions, which means the next time you draw the bitmap it will be re-decoded (and thus it will draw slightly slower). This has proved very handy in Maps for dealing with OOM errors; unfortunately the technique is not yet included in the framework that MapView uses. --Adam Bliss --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

