Quoting Squirrel documentation:
Squirrel uses reference counting (RC) as primary system for memory management; however, the virtual
machine (VM) has an auxiliary mark and sweep garbage collector that can be invoked on demand.
...
The default configuration consists in RC plus a mark and sweep garbage collector. The host program
can call the function sq_collectgarbage() and perform a garbage collection cycle during the program
execution. The garbage collector isn’t invoked by the VM and has to be explicitly called by the host
program.
There is also Squirrel function collectgarbage(), but it doesn't work in AI code ("the index 'collectgarbage' does not exists").
Cleaning up circle references manually is not an option, as AI does not have a chance to do cleanup when it is terminated. Not using circle references is extremely incovenient and might be difficult to avoid.
Why not to use Squirrel garbage collector?