Use less memory. On Mon, Jun 8, 2009 at 9:39 PM, [email protected]<[email protected]> wrote: > > I get a OutOfMemoryError at BitmapFactory.decodeByteArray when bitmap > size is large; Following is the code snippet: > > BitmapFactory.Options options = new BitmapFactory.Options(); > options.inSampleSize = 8; > Bitmap bitmap = null; > bitmap = BitmapFactory.decodeByteArray(data, 0, data.length, > options); > > where data is a byte array of length 407287 > > I tried using bitmap.recycle, setting the bitmap to null and setting > BitmapFactory options SampleSize but still I get the following error: > > > ERROR/AndroidRuntime(5399):java.lang.OutOfMemoryError: bitmap size > exceeds VM budget > ERROR/AndroidRuntime(5399):at > android.graphics.BitmapFactory.nativeDecodeByteArray(Native Method) > ERROR/AndroidRuntime(5399):at > android.graphics.BitmapFactory.decodeByteArray(BitmapFactory.java:308) > > I have seen a few posts related to this issue but could not find a > solution. Could anyone please let me know how to fix this issue? > > >
-- Romain Guy Android framework engineer [email protected] Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

