Game Stuttering that isn't GC

Problems with Canvas, OpenGL, etc...

Game Stuttering that isn't GC

Postby seed » Mon Jun 14, 2010 6:55 pm

I am getting occasional stuttering in my game that doesn't seem related to garbage collection. I instrumented my main rendering loop to figure out which part of my code this was happening in and discovered that it is happening randomly in all parts of my code. But it isn't accompanied by a any catlogs about gc.

The stutters are between 40-250 msecs long. Any time they happen, the glitch in the game is very noticable and is really ruining things.

Is this android services running in the background? Can I do anything to mitigate this? Any other ideas of what I can check for / do? Is this unavoidable?

Thanks,
Seed
Visit Exit 4 Gaming - http://www.exit4games.com/
Home of LavaBall - http://exit4games.com/?page_id=3
Home of Rebound - http://exit4games.com/?page_id=138
Home of Tap Crazy - http://exit4games.com/?page_id=219
Download "Caveman Pool" From the Market Today!
seed
Senior Developer
Senior Developer
 
Posts: 103
Joined: Mon Mar 15, 2010 3:22 pm

Top

Re: Game Stuttering that isn't GC

Postby ShadowKntSDS » Tue Jun 15, 2010 12:39 am

Have you tried using Traceview to profile your code?
ShadowKntSDS
Junior Developer
Junior Developer
 
Posts: 15
Joined: Wed Apr 28, 2010 10:29 pm

Re: Game Stuttering that isn't GC

Postby seed » Tue Jun 15, 2010 2:09 pm

No, I have no experience with it. I will see if I can figure it out. The app runs exceedingly slow when debugging. Will this be an issue for traceview too?
Visit Exit 4 Gaming - http://www.exit4games.com/
Home of LavaBall - http://exit4games.com/?page_id=3
Home of Rebound - http://exit4games.com/?page_id=138
Home of Tap Crazy - http://exit4games.com/?page_id=219
Download "Caveman Pool" From the Market Today!
seed
Senior Developer
Senior Developer
 
Posts: 103
Joined: Mon Mar 15, 2010 3:22 pm

Re: Game Stuttering that isn't GC

Postby ShadowKntSDS » Tue Jun 15, 2010 4:28 pm

You typically would not run traceview while debugging. It will show you how long you spend in each section of your code, and the debug process would mess that up. It will also show interactions between threads.
ShadowKntSDS
Junior Developer
Junior Developer
 
Posts: 15
Joined: Wed Apr 28, 2010 10:29 pm

Re: Game Stuttering that isn't GC

Postby ClockworkAlchemist » Tue Jun 29, 2010 4:11 pm

I assume you tried rebooting the phone, putting it in "Airplane Mode" (turn turn off radio stuff), closing widgets, and using a task manager to kill as many things as possible, right?

If so, and if it's hitching in openGL code, you could try caching state changes, and only sending state changes through that are new. Something like:

Code: Select all
public final class RenderState
{
  static int sTexture = -1;
  static GL10 sGL;

  final static void startRendering(GL10 gl)
  {
    sTexture = -1;
    sGL = gl;
  }

  final static void setTexture(int texture)
  {
    if (texture != texture)
    {
      sTexture = texture;
      sGL.glBindTexture(target, texture);
    }
  }

}
ClockworkAlchemist
Junior Developer
Junior Developer
 
Posts: 14
Joined: Sun Feb 08, 2009 3:41 am
Location: Orange County, CA

Re: Game Stuttering that isn't GC

Postby tttcowan » Mon Jan 17, 2011 6:01 pm

Did you get any further with this seed? I seem to be having a very similiar problem.

Thanks
tttcowan
Developer
Developer
 
Posts: 46
Joined: Mon Jul 19, 2010 11:08 pm

Top

Return to Android 2D/3D Graphics - OpenGL Problems

Who is online

Users browsing this forum: No registered users and 2 guests