The garbage collector implemented in AngelScript is incremental, so it can be executed for short periods of time without requiring the entire application to halt. For this reason, it is recommended that a call to GarbageCollect(false) is made at least once during the normal event processing. This will execute one step in the incremental process, eventually detecting and destroying objects being kept alive due to circular references.
This is not enough however, as executing the garbage collector like this will require many iterations to complete a full cycle. Thus if the scripts behave extremely badly and leave a lot of dead objects with circular references, the objects will accumulate faster than the garbage collector can detect and free them. For this reason it is necessary to monitor the number of objects known to the garbage collector, and increase the frequency of the GarbageCollect calls if it increases a lot. Call the method GetObjectsInGarbageCollectorCount to determine the number of objects.
Finally, if the application goes into a state where responsiveness is not so critical, it might be a good idea to do a full cycle on the garbage collector, thus cleaning up all garbage at once. To do this, call GarbageCollect(true).