1

Currently I am working on an Air app for iOS and Android. Air 3.5 is targeted. Performance on iPhone 4 / 4s has been acceptable overall, after a lot of optimising: gpu rendering, StageQuality.LOW, avoiding vectors as much as possible etc. I really put a lot of effort in boosting performance.

Still, every once in a while, the app becomes very slow. There is no precise point in time or action or combination of actions after which this occurs. Sometimes, it doesn't occur for days. But when it occurs, only killing the app and launching it again helps, because the app stays slow after that. So I am not talking about minor hiccups that The problem occurs only on (some) iPhones 4 and 4s. Not on iPad 3,4, iPhone 5, any Android device...

Has anyone had similar experiences and pointers as to where a solution might be found? What happens when gpu memory fills up? Or device memory? Could this be involved?

Reinier
  • 88
  • 6
  • What do Instruments tell you? What traces can you show us? – Robotic Cat Jan 22 '13 at 18:18
  • [What are the major performance hitters in AS3 aside from rendering vectors?](http://stackoverflow.com/questions/8380789/what-are-the-major-performance-hitters-in-as3-aside-from-rendering-vectors) – Jason Sturges May 27 '13 at 08:03

2 Answers2

1

Please don't expect Adobe Air to have performance as Native Apps. I am developing App with Adobe Air as well.

By the sound of your development experience. I think it's to do with memory issue, because the performance is not too bad at the begging stage, but it gets bad overtime (so u have to kill the app). I suggest you looking into memory leaking issue.

Bill
  • 17,872
  • 19
  • 83
  • 131
0

Hopefully my experience can help you.

I had a similar problem where sometime during gameplay the framerate would drop from 30fps to an unrecoverable 12fps. At first I thought I was running out of GPU memory and it was falling back on rendering with CPU.

Using Adobe Scout I found that when this occurred, the rendering time was ridiculousness high.

Updating to Air 3.8, I fixed the problem by limiting the amount of bitmaps that were being rendered and in memory at once. I would only create new instances of backgrounds for appropriate levels, and then flagging them for garbage collection when the level ended, waiting a few seconds and then moving to the next level.

What might solve your problem is if you reduce the amount of textures you have in memory at one time, only showing the ones you need to. If you want to swap out active textures for new ones, set all the objects with that texture data to null:

testMovieClip = null;

and remove all listeners from it so that garbage collection will pick it up. Next, you can force garbage collection with AIR:

System.gc();

Instantiate the new texture you want to render a few frames after calling gc. Monitor resources with Scout and the iOS companion app to confirm that it's working.

You could also try to detect when the framerate drops, and set some objects to null then force garbage collection. In my case, if I moved my game to an empty frame for a few seconds with garbage collection, the framerate would recover and the game would resume rendering with GPU.

Hope this helps!

Exbia
  • 51
  • 6