Let me start by figuring out what this question is NOT. This is not a request for a simple explanation of how flash memory or garbage collection works (reference counting, marking and sweeping, etc.). Also, this is not a request for troubleshooting tips for memory leaks (e.g. reprocessing, weak links, removing an event listener, IDispose pattern, stopping timers, excluding static pointers and pointers from a global object such as a stage, etc.)
Suppose you have a large enough Flex program encoded in MXML and Actionscript, and assume that it is encoded by people who are pretty good at all of the above and think that STILL has a memory leak. At this point, you need to debug the problem, and the question is how to do it.
The Flash Builder Premium IDE can take a snapshot at time A and time B, and then compare two snapshots and then report broken objects. To use this, the program starts in a steady state (time A), then it starts a little more (time B), and the implicit assumption is that the system should contain approximately the same objects - if it is not then new - "loitering " (memory leak). Conveniently, the IDE will provide a list of pointers leading to each placing object.
But the IDE does not provide critical information: which of these pointers “locks” the object in memory and prevents garbage collection, as well as just pointers from child objects (loops), which should go away naturally if the object is assembled. While the IDE points to some pointers as "gcroot", anecdotal pointers from child objects are often (usually!) Marked as gcroot, so this flag does not provide the necessary information. Since a program with a sufficiently large size can contain many objects, and since they can be connected on a complex schedule using pointers, it is difficult to use the IDE to determine which pointers cause a memory leak.
, : - - ( , ) , Flex, ActionScript MXML?