Garbage collection is the act of removing objects that are no longer needed from memory. Memory used by instances that no longer have any references to them should be deallocated during this process.
Flash Player performs garbage collection as necessary during an application's life cycle. Unreferencing an object does not trigger garbage collection. So, when you remove all references to an object, the garbage collector does not necessarily deallocate the memory for that object. That object becomes a candidate for garbage collection.
Clicking the Run Garbage Collector button does not guarantee that all objects that are eligible for garbage collection will be garbage collected. Garbage collection is typically triggered by the allocation of memory for new resources. When new resources require memory that is not available in the current allocation, the garbage collector runs and frees up memory that has been marked for deallocation. As a result, even if you remove all references to it, it might not be immediately garbage collected, but likely will be garbage collected when other instances are created and used. If an application is idle, you can watch its memory allocation. Even though there may be objects that are marked for collection, an idle application's memory usage typically does not change until you start interacting with it.
Flash Player allocates memory in blocks of many bytes, and not one byte at a time. If part of a block has been marked for garbage collection, but other parts of the block have not been marked, the block is not freed. The garbage collector attempts to combine unused portions of memory blocks into larger blocks that can be freed, but this is not guaranteed to occur in every pass of the garbage collector.
Garbage collection occurs implicitly before memory snapshots are recorded. In other words, clicking the Take Memory Snapshot button is the equivalent of clicking the Run Garbage Collector button and then clicking the Take Memory Snapshot button.
Run garbage collection while profiling your application
Select the application in the Profile view, and click the Run Garbage Collector button.
You analyze the garbage collector's effectiveness by comparing two memory snapshots before and after garbage collection occurs.