Hi,

It's pretty easy. Launch the tool called DDMS (the standalone one, not
the one that comes with the Eclipse plugin.) Inside the tool, go to
the Allocations Tracker tab. Click Start Tracking, use your app a
little, then click Get Allocations. You will get a list of all
allocations with, for each one of them, the stack trace to the
allocation.

On Sat, Feb 7, 2009 at 9:48 AM, snctln <catlin.s...@gmail.com> wrote:
>
> I am having an issue with my latest game (available in the market as
> "BreakTheBlocks Lite")
>
> This is a simple "arcade" style game, It started with a thread
> controlling the game loop but now I just have a runnable that performs
> the game loop functions and then posts back to itself.
>
> In its original release there was a noticeable "stutter" in the game
> every other second or so.  After a great deal of time debugging I
> finally realized that every time the stutter happened LogCat showed
> that garbage collection was taking place.
>
> I went through my code and got rid of creating as many "temporary"
> objects as possible.  After that the stutter went from happening every
> 1.5 seconds to happening every 13-16 seconds.  This is much better,
> but I can't seem to reduce the time any further.
>
> According to LogCat the garbage collector is still running on my game
> thread every 15 seconds I see the message "GC freed 19833 objects /
> 878848 bytes in 131ms"... and since my game runs at about 30 frames a
> second a 131 millisecond stutter causes about 4 frames to be dropped
> which is an annoyance for me and the users of my game.
>
> So my question is What can I do to further debug this problem?  I have
> always known garbage collection existed but I have never bothered to
> care about it until now because it is finally affecting the
> performance of my app (and I am a C++ programmer by day so I usually
> forget about the GC)
>
> Is there any way to see what the garbage collector is collecting?  Is
> there any way that I can tweak the behavior of the GC for my app?
>
> Sorry for the long winded question and thank you in advance for any
> responses
> >
>



-- 
Romain Guy
Android framework engineer
romain...@android.com

Note: please don't send private questions to me, as I don't have time
to provide private support.  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 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to