Simple Component For Monitoring Memory and FrameRate

I thought I should share a component I whipped together for ActionScript 3 projects in Flash that allows you to easily monitor memory usage and framerate. It’s simple, unobtrusive, and only adds 0.5kb to your SWF.

It’s only about 5 lines of code, but it’s handy to have kicking around your component panel for quick access.

Here’s a simple demo of it (it’s the little widget on the right). It just generates random ByteArray data to force the memory usage up and framerate down.

You can download the FLA for the above demo, and a SWC file that you can drop into your components directory by clicking here.

Grant Skinner

The "g" in gskinner. Also the "skinner".

@gskinner

12 Comments

  1. Hi,

    Nice work Grant.

    I released a similar set for Flash Lite developers recently. Its avaiable with source code at http://wiki.forum.nokia.com/index.php?title=Oxygen_-_The_Flash_Lite_Developers_Kit

    I have included a bar-graph to show percentage of the FPS and Memory. Maybe you’d also add graphs to this component 🙂

    // chall3ng3r //

  2. Useful! I’ve already inserted it into my project. I wish it updated the fps field a little less often though. It’s flickers around so much that I can’t really read it.

  3. Thanks! Just yesterday I wasted a few minutes looking for that “fps bar widget” that nearly all papervision3d experiments have in the top left corner… couldn’t find it, yours will do just fine 🙂

  4. Nice! Small and simple. I can really but this to good use. Thanks!

  5. Is there a way to mmake it work in flex? I linked the swc but I can’t find the classes. Thanks

  6. chall3ng3r, I considered adding some features like this, but I like the simplicity of it as is.

    Eric, I might add a bit of dampening. For my purposes I preferred the immediate feedback, but I realize a lot of people will likely want it to be averaged over a few frames.

    Simon, not at present, but I’ll try to whip up a Flex version later today or tomorrow.

  7. Not to say one is better or worse, but i’ve found this tool invaluable.

    Idea is the same, however it tells you the average and the current, and there’s a graph that lets you watch as your memory usage creates peaks and valleys.

    Also it’s as simple as:

    var activeGraph = new ActiveGraph();

    addChild(activeGraph);

    ————-

    the author doesn’t have a website, but you can get it from here.

    http://www.kirupa.com/forum/showthread.php?t=262507

  8. Stupid question. I am just developing flash project.

    How can I use the provided .swc file in Flash IDE? or need to use the library symbol in the provided .fla files.

    Thx,

  9. “drop into your components directory”

    sorry, just being stupid….

  10. Excellent little component. Thanks.

  11. for flashdevelop :

    add the memorygauge.swc to the lib folder then right click on it “add to library”

    and in your app write this code :

    var memoryLevel:MemoryGauge = new MemoryGauge();

    addChild(memoryLevel);

  12. Do you know of any AS2 memory gauge/components? Need one for a project. Thanks!

Leave a Reply

Your email address will not be published. Required fields are marked *