Depends where it's placed at. I calls to the GC "scattered" all over,
but with discretion. I made a concious design decision to avoid
allocating memory in the presentation layer which is handling user
interactions. I rely on a separate thread to handle all "back end"
activities such as capturing and processing data, and found it is safe
to call the garbage collector in this separate thread at pretty much
any time. Garbage collection in this archiecture is just one other
activity that will not interfere with the user experience, as long as
the overall burden on resources remains within device capabilities.

On Dec 22, 12:41 pm, Dan Bornstein <[email protected]> wrote:
> On Sun, Dec 21, 2008 at 11:34 PM, Imran <[email protected]> wrote:
> >    hey  can  i use System.gc()  in my activity to request for garbage
> > collection.
> >     will it work () ..   will the garbage collector be called ?
>
> Yes it will. However, let me warn you that in my experience adding
> explicit calls to System.gc() almost always results in applications
> that perform worse than ones that just let the underlying VM gc as it
> sees fit.
>
> -dan
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to