Get free/used memory info

I’m writing code for a system that is very limited in it’s memory. I’ve written some code to cache the data and movieclips used, but eventually I’ll need to free some memory before I run out (and flash is terminated)

Is there a way to find out

  • how much memory flash/my .swf is using in total?
  • how much memory is free?
  • how much memory an object or movieclip (including it’s children) occupy?

I’m looking for something to decide wether or not I should release some memory. it doesn’t need to be very precise, just anything I can use as an indicator in actionscript 2.0

I’ve found that in Flash Lite I can use


fscommand2("GetTotalPlayerMemory")
fscommand2("GetFreePlayerMemory");

but unfortunately I’m not using Flash Lite and these commands don’t seem to exist in flash 7+.

Is there anything I could use?