What is the maximum memory that a Flash movie can use in a browser?
I need to store a lot of data coming from the server into memory, so I have to write my memory storage algorithms based on how safe I can use it without freezing or crashing the browser.
Is there some safe size, for example 1 MB or 100 MB, that the content of global variables should not exceed?
source to share
You can check how much memory you are using:
trace("MEMORY USAGE: " + (System.totalMemory/1048576) + "MB");
Use this to help localize memory leaks and improve garbage collection code.
ActionScript 2 says you should clean up and dispose of dynamically generated objects for fast GC.
myArray[0] = "value";
myArray[0] = null; // to Garbage Collect
delete myArray[0];
source to share
There are no hard and fast limits, but for developing flash games targeting middle and lower end machines, we found that keeping our memory size below 500MB reduced random crash significantly.: -D You will likely see other scalability limitations (power processing, single-threading) before you see memory capacity limitations unless you are generating a lot of data locally, procedurally (e.g. with generated bitmaps.)
I always recommend switching to AS3, but I don't think the memory management will be show-stopper in AS2.
source to share