fadden <[email protected]> wrote:
>On Aug 11, 10:03 am, Indicator Veritatis <[email protected]> wrote: >> Indeed: there seems to be a consensus among certain very experienced >> Java users, including Scott Myers ("Effective Java") and Bruce Eckel >> ("Thinking in Java"). That consensus is that there are three >> conspicuous mistakes in the design of Java: thread groups, classpath >> and finalizers. > >FWIW, _Effective Java_ was written by Josh Bloch. Myers wrote >_Effective C++_. (I highly recommend both.) > >> Of course, it doesn't help that even those of us who should know >> better confuse the Java notion of 'finalizer' with the C++ notion of >> 'destructor'. They are not as close as they may seem; finalizers are >> only very occasionally useful since, as you point out, there is no way >> to be sure they are even called. > >They're useful when the primary content is, "assert(cleanup is done)". > > >Some changes to the GC and the way Bitmaps work will appear in a >future Android release. The best thing you can do right now is use >Bitmap.recycle() if you have knowledge of your Bitmap life span, since >that discards the pixel data buffer without needing to go through the >garbage collection mechanism at all. (It still has to do the >finalizer dance, but the small native structs associated with every >Bitmap aren't counted against the VM heap limit.) > >-- >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

