# Memory Management

One of the new features of &app; &appversion; is the garbage collector. The garbage collector manages complex &AS; variables, which are the only ones that are shared by references. In &app;, these are `as_object` class instances created by &AS; (i.e. not those created by playhead control: `placeobject`/`removeobject`).

Collected objects are those allocated due to &AS; explicit or implicit calls. Explicit all are any user-defined statements that allocate new objects, such as arrays, Objects, or script-created movieclips. Implicit calls are the built-in functions that can be deleted by arbitrary user calls.

Any object that is a candidate for garbage collecting is stored in a list owned by the collector. This list is filled by an executing action context whenever a collectible object is allocated on the heap.

The garbage collector starts at the very end of an execution context, rather than using a threshold to trigger it. At this point, the virtual machine is in a "stable" state; any still-reachable object has its roots in one of the currently live character instances (stage characters).

The collector is a conservative collector. Any object on the collectibles list is marked as UNREACHABLE, an iterative scan starting from the roots marks any still-reachable object, and a final purge releases all still-UNREACHABLE resources.

This garbage collector has reduced the memory footprint of &app;. However, the most current, available test data indicated the following runtime memory footprint: