Memory Management

BlitzMax uses a technique known as reference counting to keep track of objects that are in use by your program. This includes all instances of user defined types, strings and arrays.

The basic idea behind reference counting is that each object includes a counter reflecting the number of variables referencing that object. When an object's counter reaches 0, the object is no longer in use and its memory can be returned to the system.

However, this process is not completely automatic, and BlitzMax requires you to execute the FlushMem command periodically in order to return unused memory to the system.