How do you know if your compiled SWF file has a memory leak?
Are there tools, a firebug setting, etc… to see if there is a problem? I cannot find much in the debug Flash player besides file size and loading time.
I have a large Flash application that I maintain and suspect that is using way too much memory so I wanted to measure the amount of RAM being used while it executes to find key areas to optimize.
Any help would be greatly appreciated.
All you can really do is examine your memory usage when the application starts, and as it is changed.
To get the amount of memory currently in use you can do:
do this at the very start of your application (ie, when everything has finished loading)
then, start a Timer and use TimerEvent.TIMER handler or add an Event.ENTER_FRAME event listener and do this:
Now you have the initial_memory usage as well as the current_memory usage. How you choose to use these is up to you. You can subtract initial_memory from current_memory to get your delta. You can display them in a text field on your stage, write them to FireBug’s console, or trace them in the output window.
Then just click around. If you do something that increases the memory, that is ok. But, if you have something that should be unloaded, and is not, then you have a leak.