You don't have to call it yourself, but you can if you want to give it
a hint that right now would be a good time to clean up. Even then,
there is no guarantee it will do anything. Heres an example - say you
have an action game which does the minimum possible (but still some)
allocations during play, then pauses at an "end of level" dialog. If
gc didn't run, during the next level, its new allocations might
trigger one just when you don't want it. So as the user is paused at
the dialog anyway, a call to System.gc() could help by clearing up
from the first level.

--
Android Academy http://androidacademy.com

On Aug 18, 10:36 pm, human android <[email protected]>
wrote:
> Do I have to make explicit calls to do garbage collection?
> runtime.gcSoftReferences()
> runtime.runFinalizationSync()
>
> Doesn't javas automatic garbage collection take care of it on its own?
--~--~---------~--~----~------------~-------~--~----~
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