Hi:
some of you may met the same problem, I was using
BitmapFactory.decodeStream, and got this exception:

03-01 23:28:17.663: ERROR/dalvikvm-heap(940): 1572864-byte external
allocation too large for this process.
03-01 23:28:17.663: ERROR/(940): VM won't let us allocate 1572864
bytes
03-01 23:28:17.663: DEBUG/skia(940): --- decoder->decode returned
false
03-01 23:28:17.663: WARN/dalvikvm(940): threadid=27: thread exiting
with uncaught exception (group=0x4001b188)
03-01 23:28:17.663: ERROR/AndroidRuntime(940): Uncaught handler:
thread Thread-14 exiting due to uncaught exception
03-01 23:28:17.663: ERROR/AndroidRuntime(940):
java.lang.OutOfMemoryError: bitmap size exceeds VM budget
03-01 23:28:17.663: ERROR/AndroidRuntime(940):     at
android.graphics.BitmapFactory.nativeDecodeStream(Native Method)
03-01 23:28:17.663: ERROR/AndroidRuntime(940):     at
android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:459)
03-01 23:28:17.663: ERROR/AndroidRuntime(940):     at
cc.pa.BitmapManager.fetchBitmap(BitmapManager.java:39)
03-01 23:28:17.663: ERROR/AndroidRuntime(940):     at
cc.pa.BitmapManager$2.run(BitmapManager.java:88)

I know the reason is because the BitmapFactory is trying to decode an
uncompressed version of a big image(in my situation, jpg). I can use
BitmapFactory.Options.inSampleSize to fix it. but my question is
what's the maximum size that VM would like to allocate for loading a
image with BitmapFactory? so I can do some scale before it loads.

thanks
wei

-- 
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