On May 1, 2013, at 10:04 AM, Igor Velikorossov <[email protected]> wrote:
> I've read the "Take a Picture and Save Using Camera App" example and
> downloaded provided sample
> (http://docs.xamarin.com/recipes/android/other_ux/camera_intent/take_a_picture_and_save_using_camera_app).
Thank you for mentioning this. We will update the recipe accordingly.
> However it looks the sample is either too inefficient or there is a mono's
> issue - just after one picture grab it grows heap by 30M and almost exhausts
> available memory on Samsung Galaxy S2. Attempting showing a 2nd picture
> crashes and burns the app with Java.Lang.OutOfMemoryError.
> I find it especially curious given that the size of the picture taken is mere
> 2-3M in size.
The _compressed_ filesize is 2-3MB. That has no relation to the amount of
memory needed to display the image, which requires decompressing it. The
Samsung Galaxy S2 has an 8MP camera, so if you assume 4 bytes/pixel (RGBA) a
decompressed image will require ~31.9MB, which is about what you see.
The solution is to merge the "take a picture" recipe with the "Load Large
Bitmaps Efficiently" recipe:
http://docs.xamarin.com/recipes/android/resources/general/load_large_bitmaps_efficiently
- Jon
_______________________________________________
Monodroid mailing list
[email protected]
UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid