OK, *this* program leaks a reference each time around; probably a missing decref in the compiler: source = """\ def conjoin(gs): def gen(): gs # unbreakable cycle gen # unless one is commented out """ def one(): exec source in {} import sys, gc lastrc = 0 while 1: one() gc.collect() thisrc = sys.gettotalrefcount() print thisrc - lastrc, lastrc = thisrc