Skip to main content
Participating Frequently
Aug 8, 2011 1:03 PM UTC
Question

System.gc in release build.

Hi at all,

is it possibile use System.gc() into a release build (mobile application).

My usage in ViewNavigatorApplication:

protected function init(event:FlexEvent):void
{
      NativeApplication.nativeApplication.addEventListener(Event.ACTIVATE, onActivate, false, 0, true);
      NativeApplication.nativeApplication.addEventListener(Event.DEACTIVATE, onDeactivate, false, 0, true);
}

protected function onActivate(event:Event):void
{
    stage.frameRate = 24;
    event.stopPropagation();               
}
           
protected function onDeactivate(event:Event):void
{
        event.stopPropagation();
        stage.frameRate = 4;
       System.gc();
}

Thanks!

F.

This topic is closed to new replies. Start a new post to keep the conversation going.

2 replies

Colin Holgate
Inspiring
Aug 8, 2011 1:07 PM UTC

I have used it when going from one scene to another, to clear out any no longer used graphics (hopefully). It did seem to help at the time, though that was with the origin CS5 packager.

Translate
Participating Frequently
Aug 8, 2011 1:29 PM UTC

Ok! Thanks Colin.


Translate