It eventually will but it might take a couple of GC passes before it happens. We changed the way bitmaps are allocated in Android 3.0 to avoid this issue.
On Tue, Apr 10, 2012 at 1:32 PM, Latimerius <[email protected]> wrote: > Hi all, > > I was checking the way memory is used by my code and bumped into > something that made me wonder. Here's what I do at some point: > > - log Debug.getNativeHeapAllocatedSize() > - use AssetManager.open() to get a stream that I pass to Bitmap.decodeStream() > - pass the decoded Bitmap to GLUtils.texImage2D() to make a GL texture out of > it > - call Bitmap.recycle() on the bitmap > - finally, log Debug.getNativeHeapAllocatedSize () again > > What puzzles me is that the getNativeHeapAllocatedSize() numbers just > keep rising, most of the time quite predictably by width*height*4 > bytes and then some. I thought Bitmap.recycle() would make it go back > down again but that never seems to be the case. Am I misinterpreting > Bitmap.recycle() or Debug.getNativeHeapAllocatedSize() somehow? > > Cheers! > > -- > 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 -- Romain Guy Android framework engineer [email protected] -- 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

