Hi,

I started having to deal with new OOM errors one of my camera apps again 
recently.

First started when I got a new Samsung Galaxy S3 LTE with Android 4.1.0, 
OOM occurring after reading in an 8MP photo ok & then attempting to 
allocate additional Bitmap to create a modified copy of the original photo. 
At this time I started using largeHeap & the OOM issue went away.

Now it is happening again after the Samsung Galaxy S3 LTE was updated to 
Android 4.1.1, but this time OOM is happening when (just) reading in the 
8MP photo & still using largeHeap.

Next workaround will be to try to read the 8MP image in chunks. Immediate 
workaround is to go back to using 5MP photos.

This is really annoying as my older Samsung Galaxy S2 with Android 4.04 
works fine doing the same with 8MP photos. And it's worked ok since Android 
2.2. Other devices such as HTC One XL are ok as well...

Hohum, one step forward one step back I guess.

Regards

 

On Friday, November 23, 2012 6:33:40 AM UTC+11, Fran wrote:
>
> On 11/22/2012 03:19 PM, Piren wrote: 
> > - yeah, swearing does help calm the psyche, does not help so much with 
> > the code crashing :-P 
> I admit you are right. But I need to calm my psyche before starting 
> coding!... ;-) 
> > 
> > - "it is unlikely i need so much memory" Fact is you have an OOM 
> > exception... you're using too much memory:) 
> That's a logical fallacy, indeed. I am not getting an OOM exception due 
> my app is using too much memory, I am getting an OOM exception due the 
> underlying VM does not manage the heap properly. 
>
> Of course I can try to use less memory and may be it solves the problem, 
> but this not the REAL solution, it is just a WORKAROUND, because the 
> REAL solution should address the REAL problem. 
> > And if its happening on your first activity, it isnt a memory leak... 
> > 
> > - i dont know if largeHeap is useful, but according to documentation, 
> > it should at least lower the amount of crashes some of your users 
> > experience. 
> Oh, I forgot this... but I will take a look on that docs, thanks. 
> > 
> > - if i were your user, i'd take hdpi images rather than crashes. if it 
> > crashes, i dont use the app :) 
> Yeah, you are right on this, but the problem is not so simple: for 
> avoiding crashes for SOME users, I must release a product with lower 
> quality images for ALL of them. In fact, if they were only an 1% of the 
> users using older devices, I would simply ignore this bug at all. 
>
> Anyway I have already released a new version that uses hdpi images also 
> for xdpi devices. This has reduced heap use by a half or on such 
> devices, so I expect to have no more OOM crashes, or just 1 on 1000 in 
> an unknown device with a custom buggy ROM... 
>
> Best regards, 
>
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to