Hey guys I have been developing an endless runner game for the past month and development has been great and device performance as well except for one thing… garbage collection.
In my app I basically have pre-spawned obstacles, powerups that loop through the screen to creat an endless illusion. Performance is great, most frames take under a millisecond to compute, and about 25% others are a milliseconds or two. However every 10 - 20 seconds there is this very small stutter which is very annoying.
Upon building my app, connecting it to my PC and running ddms(an android debug utility that comes with android sdk) I noticed that the dalvik vm was freeing objects and memory every 10 - 20 seconds causing delays of 30 - 80 milliseconds. My app is set to run at 60 fps so these delays are HUGE, but even at 30 fps they would be noticeable. I am not spawning ANY new display objects, listeners, or tables, I am simply reusing all objects that I made in “createScene” and changing variables that represent game states and properties.
Since I am using storyboard I made sure to use forward declarations to make all functions, display objects, and tables local and not global.
I would really like some assistance as I have read the several memory leak related articles by ansca and other members.
Note: not using physics library [import]uid: 118482 topic_id: 28360 reply_id: 328360[/import]