Alright, I looked again and made sure to follow the allocated size across tens or hundreds of texture loads happening within a couple of minutes and it looks you're right, it does seem to go down once in a while, although by amounts not really comprehensible to me. Admittedly, that could be the behaviour of my code though. At any rate, thanks for your answer! :-)
On Tue, Apr 10, 2012 at 10:37 PM, Romain Guy <[email protected]> wrote: > 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 -- 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

