Hacker News new | ask | show | jobs
by campnic 5174 days ago
Author here. Thanks for reading. I concede that its possible to manage Bitmaps without issue. But I'd argue there are tons of resources (and SO questions) because the system in place is such a mess. Recycling bitmaps manually is a non-functional(and not elegant) solution for many use cases and really should be unnecessary in a environment featuring a GC. (though i understand why the implementation is the way it is).

I feel like it is a limitation of the framework. The problem exists because of limitations of the OS and the solutions for the problems (tiered memory-disk caches, custom remote image widgets) are "challenging" because of the limits. The problem itself (build the cache or remote widget) isn't conceptually or technically hard, its only hard because of the tools at our disposal.

1 comments

There's a good video from a recent Google I/O on memory management where they explain the recycle method, their reason for requiring it, and that it won't be necessary in 2.3 and up. I still always recycle everything manually just to be defensive, but supposedly it's not required anymore in API 10+. Whenever you see a framework object with a recycle method it's because the memory is allocated outside of the dalvik heap, so it's not part of the GC cleanup process.

The real bitch of this, and what I think you were getting at, is the lack of accurate memory debugging tools. I read a really long post on SO about a guy who tested all of the various ways of testing memory consumption through DDMS, adb, etc, and all the numbers he got were conflicting.