MAXScript uses a memory management scheme called automatic garbage collection. This means you don’t have to explicitly reclaim any memory that a value takes up when you no longer need it. When you assign a new value to a variable or when a local variable’s block exits, the reference that the variable contained is dropped. When your program has dropped all references to a value's memory, that memory becomes eligible for reclamation.
Some values, such as arrays have internal references to other values. In an array, each element contains a reference to another value. When you assign a new value to an array element, the element's old reference is dropped. If you remove all references to the array itself, all the references in the elements of that array are implicitly dropped. The same applies to component values, such as in user structs and certain MAX objects.
MAXScript reclaims memory in a garbage collection pass through memory whenever MAXScript runs out of memory. This simple approach can result in a short pause because the entire MAXScript memory is scanned for garbage. Some languages use background collectors that work continuously, others use advanced schemes that minimize the scanning. Later versions of MAXScript may adopt one or more of these techniques.
The advantage of garbage collection is that you can create as many values as you need, and MAXScript cleans up the ones you no longer use.