I've tried it with no de-bugger, on the emulator, and on actual G1 hardware, I can't seem to get rid of the problem entirely. I only process and use one bitmap at a time, bitmaps are recycled after use, and I invoke gc(). The Runtime free memory indicates that I always have over 10 MB free, each bitmap is less than 3.5 MB, yet this problem still ocurs intermittently. I've about run out of ideas, I wish I knew if there were a solution to this problem, or if it is a bug in BitmapFactory. There isn't another way to produce bitmaps from files in Android as far as I know, so this is a big probem.
Mark On Jan 9, 4:18 pm, EboMike <ebom...@gmail.com> wrote: > Mark, did you try running without a debugger attached like I suggested > earlier in this (or some other) thread? That fixed the BitmapFactory > problems for me. > > On Jan 9, 1:53 pm, Mark K <mark.ka...@gmail.com> wrote: > > > > > As mentioned in other threads I've also had consistent problems > > with BitmapFactory.decodeFile() causing out of memory problems where > > there should be lots of memory available. I'm quite sure there is some > > kind of bug causing this problem, but I cannot get this officially > > confirmed. Many other developers have noticed similar problems with > > the BitmapFactory, hopefully it will be resolved at some point in the > > future. > > > On Jan 9, 12:54 pm, fadden <fad...@android.com> wrote: > > > > On Jan 8, 8:06 am, EboMike <ebom...@gmail.com> wrote: > > > > > For a simple demonstration of how BitmapFactory leaks, try this: > > > > In the debugger, add an exception break on caught/uncaught instances > > > of IOException, and you will see BitmapFactory.decodeStream() calling > > > BufferedInputStream.reset(): > > > > try { > > > is.reset(); > > > } catch (IOException ex) { > > > // ignore > > > } > > > > The reset() function is documented as throwing an IOException if the > > > mark is invalid or not set. Apparently this happens on every attempt > > > to decode a file. > > > > As a result, it's leaking the exception object, which has a reference > > > to the message string and an int[] array with a compact representation > > > of the stack trace; you can see these accumulating in the DDMS VM Heap > > > summary. This is the problem I mentioned in my previous message in > > > this thread.- Hide quoted text - > > - Show quoted text - --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---