SWI-Prolog version 1.4 was the first release to support garbage collection. Together with last-call optimisation this guarantees forward chaining programs do not waste infinite amounts of memory.