Hey all,

Thank you for your replies. I don't use SQLite or the Preference
editor.
The string lookup is definitely something worth considering.

In terms of profiling, I do:

Debug.startMethodTracing("g1");

in OnCreate and then stop tracing in OnDestroy.
Are you saying that I should create 2 trace files,
say one for the first half and one for the second half
of the game and compare the results?

Sounds like a good plan - I just have no clue as to what
could be causing this degredation :(

cheers,
kk.


On Nov 14, 9:14 pm, Dianne Hackborn <[email protected]> wrote:
> Have you tried running the profiling at the beginning and then later when it
> is noticeable slower, and comparing the two results?
>
>
>
>
>
>
>
>
>
> On Sun, Nov 14, 2010 at 10:54 AM, kk <[email protected]> wrote:
> > Hi all,
>
> > I've written a game and I've noticed that after playing for about
> > 20-30 minutes the performance starts degrading.
> > By performance degradation I mean my average frames-per-second seem to
> > slowly drop.
> > I've no idea what could be causing this so any help would be greatly
> > appreciated.
>
> > I'm doing all my allocs at the beginning and the only things that
> > alloc in game according to DDMS are
> > Integer.toString operations (for integer values I need to draw with
> > drawtext) and setBounds on some drawables.
> > (I've no idea how to stop these from happening, so again, if you know
> > a way around this please do tell).
>
> > I'm calling System.gc() periodically, when I know not much is going on
> > in-game (e.g. between waves of enemies).
> > I'm doing this in order to avoid GC from happening during critical
> > gameplay periods.
>
> > If you know the answer to any of the following, please do tell (even a
> > guess would do :)):
>
> > + Why is performance degrading with time? What could be causing this?
> > + Is there a way to avoid allocs due to Integer.toString and
> > Drawable.setBounds calls?
>
> > Thank you in advance,
> > kk.
>
> > --
> > 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]<android-developers%2Bunsubs 
> > [email protected]>
> > For more options, visit this group at
> >http://groups.google.com/group/android-developers?hl=en
>
> --
> Dianne Hackborn
> Android framework engineer
> [email protected]
>
> Note: please don't send private questions to me, as I don't have time to
> provide private support, and so won't reply to such e-mails.  All such
> questions should be posted on public forums, where I and others can see and
> answer them.

-- 
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