Simple demonstration that quickly increases memory usage (and thus should be killed quickly):
While(true)
{
a := {}
b := {a : a}
a.b := b
}Is there a technical or logical reason that circular references aren't resolved? I recently had a problem due to improper use of a Delegate class which caused leaks because of this behavior.I believe that an algorithm like the following should work, please correct me if I'm wrong:
[*:3bvqtyx2]Create a list of all existing objects
[*:3bvqtyx2]For all objects referenced in global, static and local variables, recursively traverse their keys/values and remove all referenced objects from the list
[*:3bvqtyx2]All objects that are still on the list aren't reachable by script and may be deleted if they don't have an increased ref count by ObjAddRef()




