When we use the NEW keyword to instantiate an object, that Object is created and put in memory. any variable that we assign to it is actually a reference to that object. This is an efficient way to deal with objects. Max uses a concept called reference counting to automatically allocate and release memory for objects. Basically, When an object is created, each reference to it is added to a special reference counter. When that counter reaches zero, the internal Garbage Collector will release the memory that was taken up by the Object.

Fortunately, The Garbage Collection System used by Max is automatic. This means that the garbage collector will do a sweep occasionally and remove any objects that do not have references associated to them.
Our Job is to make sure we are managing the References (say Roger=null when we are done) and the Garbage Collector will take care of reference counting and freeing memory when the ref count for that object=0.

Fortunately, The Garbage Collection System used by Max is automatic. This means that the garbage collector will do a sweep occasionally and remove any objects that do not have references associated to them.
Our Job is to make sure we are managing the References (say Roger=null when we are done) and the Garbage Collector will take care of reference counting and freeing memory when the ref count for that object=0.