• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

Adobe Air Desktop memory usage.

New Here ,
Jun 04, 2019 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

575

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
community guidelines
Contributor ,
Jun 07, 2019 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.

Votes

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
community guidelines
Advocate ,
Jun 08, 2019 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.

Votes

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
community guidelines
Community Beginner ,
Jun 25, 2019 Jun 25, 2019

Copy link to clipboard

Copied

Hi ASWC,

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

Regards,

Mr12

Votes

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
community guidelines
Advocate ,
Jun 25, 2019 Jun 25, 2019

Copy link to clipboard

Copied

LATEST

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.

Votes

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
community guidelines