On Jan 8, 8:06 am, EboMike <[email protected]> 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.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---