One possible issue is that an object that holds a reference to itself and implement a __del__ method is not collected. Pick the minimal example
sage: class A(object): def __del__(self): print "delete %d"%id(self) sage: a = A() sage: a.a = a sage: del a sage: gc.collect() 2 sage: gc.garbage [<__main__.A object at 0x7fdd5ee25290>] Once you delete the self-reference it gets collected sage: gc.garbage[0].a = None sage: del gc.garbage[:] delete 140588756390544 More generally if you have a cycle of references with one element in the cycle with a __del__ this is not collected. I am not sure where is this cycle with expect/Gp though. Vincent -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at http://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.