On Mon, Oct 18, 2010 at 6:21 PM, DanH <[email protected]> wrote: > I doubt that adding content to the object would make it any more > likely to be collected. The garbage collector doesn't generally > "weigh" objects as to whether they should be collected or not. The > only differentiating factors are 1) the absolute size of the object > itself (not counting references to other objects), 2) the number of > times the object has "survived" garbage collection, and (sometimes) 3) > the class of the object.
Dan, It is true that from a single object point of view, said object is either reachable from the root or is not, hence it can be garbage collected or it can not. However would you not agree, that from a heap management and GC strategy point of view size matters? Plenty of GC performance tuning tricks talk about the heap sizes, sizes of various generations and so on. >From experience you can see, that GC kicks in much more often, when the amount of live objects on the heap increases (past certain thresholds). Heap resizing is also determined by the total size of life objects. I also know that in Android we don't have freedom to set those, which does not mean that they are not set. Please refer to following article: http://www.oracle.com/technetwork/java/gc-tuning-5-138395.html -- Daniel -- 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

