I have a game that requires continuous touch to track user movement and draws in SurfaceView. I've noticed that at about 30sec intervals system_server will kick in with a GC and cause the game to stutter. If I don't touch the screen at all system_server will be not GC. I'm wondering if anyone else has encountered this problem before. I'm using Canvas to draw around 30+ objects on screen at once and it runs pretty smoothly (56fps) until system_server steps in... Is this something inherit to SurfaceView? It looks like 3开发者_如何学PythonD games (using GLSurfaceView) don't have this problem.
I'm developing on a Samsung Vibrant.
Thanks!
Do you allocate objects before you start the game? If you construct new objects and free old ones during the game, inevitably the GC will kick in.
精彩评论