Huh. Interesting tip. Thanks a bunch Stuart. Updated the code. On Wed, May 1, 2013 at 3:16 PM, Stuart Lodge <[email protected]> wrote: > For that memory load issue, I think that Recipe should be updated. > > Make sure you are using inPurgeable too > > See > http://slodge.blogspot.co.uk/2013/02/huge-android-memory-bug-and-bug-hunting.html > > Stuart > > > On 1 May 2013 21:57, Igor Velikorossov <[email protected]> wrote: >> >> Thank you Jon, I'll study the other example. >> >> It actually didn't occur to me about image being compressed, need more >> sleep. :) >> >> >> On 2 May 2013 03:54, <[email protected]> wrote: >>> >>> ---------- Forwarded message ---------- >>> From: Jonathan Pryor <[email protected]> >>> To: Discussions related to Mono for Android <[email protected]> >>> Cc: >>> Date: Wed, 1 May 2013 10:48:40 -0400 >>> Subject: Re: [mono-android] "Take a Picture and Save Using Camera App" >>> example fails with Java.Lang.OutOfMemoryError >>> 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 >> > > > _______________________________________________ > Monodroid mailing list > [email protected] > > UNSUBSCRIBE INFORMATION: > http://lists.ximian.com/mailman/listinfo/monodroid >
-- http://www.opgenorth.net _______________________________________________ Monodroid mailing list [email protected] UNSUBSCRIBE INFORMATION: http://lists.ximian.com/mailman/listinfo/monodroid
