Skip to main content
markc888
Inspiring
November 7, 2011
Answered

Does garbage collection run in AIR -iOS app

  • November 7, 2011
  • 1 reply
  • 1572 views

I've just been through somewhat of a learning curve developing a Flash app for browser use in a broswer and setting it up with hopefully optimal memory management using Flash Professional CS5.5.

Part of the process being to make sure object have no references pointing at them when they are done with so garbage collection can clean them up.

Now I've come to port the app onto iOS for iPad. My question is... Does AIR for iOS run garbage collection?

Thanks,

Mark

This topic has been closed for replies.
Correct answer DaveGallant

yes. and you can manually force garbage collections by calling System.gc() if you are using Air 3.0

but don't try to rely too much on the gc to fix memory problems... too much to clean up causes a very noticable lag when running and it doesn't run at any predictable schedule that I can tell... if your memory get's too high, your app can be ejected and crash.

something to keep in mind, recycle and pool objects and varibles as much as you possibly can... try to use the NEW keyword as little as possible.... then kill everything during a transition or loading phase followed by a System.gc() so the lag isn't noticable.

1 reply

DaveGallantCorrect answer
Inspiring
November 9, 2011

yes. and you can manually force garbage collections by calling System.gc() if you are using Air 3.0

but don't try to rely too much on the gc to fix memory problems... too much to clean up causes a very noticable lag when running and it doesn't run at any predictable schedule that I can tell... if your memory get's too high, your app can be ejected and crash.

something to keep in mind, recycle and pool objects and varibles as much as you possibly can... try to use the NEW keyword as little as possible.... then kill everything during a transition or loading phase followed by a System.gc() so the lag isn't noticable.