movieMonitor: an AS3 performance monitor with 10.1 features

Do you want to know how your latest Flash project is performing?

Here is movieMonitor, a little widget useful to display FPS, memory usage, stage size and number of children.

It’s based upon Hi-ReS-Stats by Mr.doob, but I added some new features to fit my needs, using some of the new System properties introduced by Flash Player 10.1

The usage is simple: just add

And you’re done. You can change stage with any DisplayObject if you want.

Look at this example:

Let’s see what do these figures mean:

FPS: current amount of frames per second (after the “/” you can see the amount of frames per second set in movie properties)

Minute average: the average amount of frames per second in the latest minute

ms per frame: the amount of milliseconds needed to draw the current frame

Direct: the amount of memory (in Megabytes) currently in use that has been directly allocated by Flash Player

Max direct: the maximum amount of memory allocated by the Flash Player so far

Total: the entire amount of memory (in Megabytes) used by the application, including the memory used by the container application, such as the web browser

Garbage: the amount of memory (Megabytes) that is allocated but not in use. This unused portion of allocated memory fluctuates as garbage collection takes place

Width: the width of the stage, in pixels. The width is calculated based on the bounds of the content of the stage (after the “/” you can see the stage width set in movie properties)

Height: the height of the stage, in pixels. The height is calculated based on the bounds of the content of the stage (after the “/” you can see the stage height set in movie properties)

Children: the number of DisplayObjects in the movie.

This is the script:

And this is the class for you to download. If you’d like to see more features, just let me know and I will be glad to add them.

  • I think this could evolve in a cute full little game. A “physical” version of Williams Moon Patrol, where a vehicle can move right, jump craters and shoot over him enemy aliens.

    There could be different planets with different types of slopes, different enemies that can alter the planets and so on.

  • 20 fps in this demo. this is useless ;)

  • Emanuele Feronato

    it’s due to the debug draw.

  • Ovidiu

    Thankyou so much! I will use this today :)

  • rreis

    It´s an amazing thing…

    But, just to notify… there´s a warning when I compile the script…

  • cool :)

    but you should use opaque background, better perfs and keep perfect lisibility in quality.LOW.

    moreover, there is no alpha with opaqueBG witch is a good thing for a performance monitor ^^

  • This is a great script for checking performance i will definitely be using this from now on. Just wanted to say Thanks for your awesome Blog and you’re great book it has helped get to grips with making flash game immensely.

  • Pingback: Cool Stuff with the Flash Platform - 9/8/2011 | Remote Synthesis()

  • Yo Emanuele I love your tuts. Just wondering are you carrying on with this tiny wings tutorial? Maybe show us how to skin it without using debug draw?

    If you do carry it on, can you show us some things like a level objective? or powerups.. Looking forward to many more tuts.

    Thanks Emanuele.

  • it’s cool~! :0

  • adit

    i’m having error on System.privateMemory and System.freeMemory
    the properties not found
    using flash develop on flex sdk 4.5.1

    Error: Access of possibly undefined property privateMemory through a reference with static type Class.

    Error: Access of possibly undefined property freeMemory through a reference with static type Class.

  • g

    Hi, do you have a simple FLA with the code added? I can’t get it to work.

  • drunkcat

    Hi, version optimalized for mobile (ie. bitmap fonts) would be a really nice improvement :)

  • Pingback: Raiden part 2 | Artits Rastas()

  • Wayne

    Hi Emanuele,

    Just a quick word to say a big thank you for your excellent work – I’m doing some mobile dev in flex & flash and this tool really helps point out the areas that effect the memory management (all the more important in mobile apps). Keeping track of the number of children an GC memory helps needle down to areas that could cause lag.

    Fantastic work!

    My best,


  • helgeus

    Man thank you for your widget. Helped me clear out a couple of points about the app I’m developing.
    N.B. Useful info for the newbies to AS3 just like me: to move the widget about the stage where it don’t interfere with the content on the stage add
    this.x= and this.y= to the movieMonitor constructor.

  • pabrikamatir

    hi, very nice! thank you very much :)