Now that you point it out, I suspect some people have a serious, basic misconception here.
The "world" in "stop-the-world" GC is simply THAT VM INSTANCE. Which usually maps to that process, though it's theoretically possible to have non-Java threads that continue to run, so long as they don't touch Java stuff. It does NOT AFFECT other processes. Other processes are just that. Other processes. Their GC is *ENTIRELY INTERNAL* to their behavior. It is just some more CPU work that process does just like any other CPU work. The only visible characteristics of their GC are: 1) GC occurs in spurts of a particular size, so a period of GC operation will never be less than a certain interval. The total interval may be longer, because it's always merged with the other CPU work being done. 2) GC tends to touch a lot of memory, which can trigger paging activity 3) GC prints out into the logcat log that it's happening. I repeat: GC work in other processes has no SPECIAL impact on your process. It's just some work going on in a competing process. The "stop-the-world" aspect of GC is simply that this GC can't handle other threads changing THIS PROCESS'S memory while it's doing its work. Each application runs in its OWN PROCESS. (Except you can arrange for two of your own apps to run in the same process. They get loaded by separate classloaders, though, so there's even less reason to do this than you might suppose). GC in your OWN process has a very different, VASTLY larger impact. The two are simply not comparable situations. Thank you for your nice empirical demonstration of this. I hope this spares people from focusing overmuch on details of what other processes are dong. On Mar 14, 4:33 pm, Lance Nanek <[email protected]> wrote: > Good point. Some quick trials here do seem to indicate that the GC > firing in a different process doesn't stop the world for a game like > the GC firing in the game's does. So GC from other processes isn't as > bad. Tested on a Droid running Android 2.0.1. -- 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

