gc_collect [function]

gc_collect()

Runs the garbage collector on the virtual machine, waiting until it has finished

a = [];
a.push(a); // creates a circular dependency
a = null; // a is not actually freed
gc_collect(); // a is freed now