Highlighted

Adobe Air Desktop memory usage.

New Here ,
Jun 04, 2019

Copy link to clipboard

Copied

Hi I'm updating a simple interactive book app which is now crashing after a few hours use.

when I run it in the flash IDE (well it's Animate) and trace out Number( System.totalMemory / 1024 / 1024 ) it stays steady round 10 meg.

When I build the installer file using the latest air for desktop this starts at 10meg and rises an extra 30 meg every hour.

Even though there's just some text onscreen and an Event.ENTER_FRAME running the trace.

Am I being daft ? Did something change in Air in the past two years that means it slowly leaks like a tap ?

Any help VERY APPRECIATED

thanks,

KingBaggot

TOPICS
Development

Views

340

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Adobe Air Desktop memory usage.

New Here ,
Jun 04, 2019

Copy link to clipboard

Copied

Hi I'm updating a simple interactive book app which is now crashing after a few hours use.

when I run it in the flash IDE (well it's Animate) and trace out Number( System.totalMemory / 1024 / 1024 ) it stays steady round 10 meg.

When I build the installer file using the latest air for desktop this starts at 10meg and rises an extra 30 meg every hour.

Even though there's just some text onscreen and an Event.ENTER_FRAME running the trace.

Am I being daft ? Did something change in Air in the past two years that means it slowly leaks like a tap ?

Any help VERY APPRECIATED

thanks,

KingBaggot

TOPICS
Development

Views

341

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Jun 04, 2019 0
Contributor ,
Jun 07, 2019

Copy link to clipboard

Copied

Check all your listeners,  You're likely missing something.  make sure they're all  useWeakReference = true.

I've multi-media apps that run for weeks at a time on Desktop, I've not seen anything like that.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jun 07, 2019 0
Advocate ,
Jun 08, 2019

Copy link to clipboard

Copied

You have a memory leak probably. It means the app is creating objects (can be anything) but not qualifying them for GC (not removing correctly references).

To keep track of objects destruction/non destruction, you can use a Dictionary (probably in a static class) with weakreference = true and store in there all objects you want to monitor. Then you can watch that dictionary size. If you are interested with that system of monitoring object destruction and want more info just let me know.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jun 08, 2019 0
Community Beginner ,
Jun 25, 2019

Copy link to clipboard

Copied

Hi ASWC,

I'd be interested in hearing a bit more about that.

Regards,

Mr12

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jun 25, 2019 0
ASWC LATEST
Advocate ,
Jun 25, 2019

Copy link to clipboard

Copied

The basic idea, create a class with this: (let's call it TrackWeakObjects)

static public var instanceKeys:Dictionary = new Dictionary(true);

Each time you create an object in your code (can even do it in a constructor) add it to the dictionary:

var sprite:Sprite = new Sprite();

TrackWeakObjects.instanceKeys[sprite] = true;

Now you can count how many object you create and how many get removed:

public static function count():uint

{

    var count:uint;

    for(var i:* in instanceKeys)

    {

         count++;

    }

   return count;

}

trace the "count" every 10 seconds. If you cleanup correctly your objects then this "count" should stay steady and not grow too much, if you don't then this count will keep increasing as you keep using the app. That's the basic idea, you can come up with a more complex system that tracks class instances, etc.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jun 25, 2019 1