STINNER Victor <vstin...@python.org> added the comment:
Anthony Sottile: I'm surprised that AST nodes survive until the last GC collection. It seems like somehow a reference cycle prevent to delete these nodes, and this reference cycle is kept alive somehow until the last GC collection at Python exit. It would be interesting to follow references. You may start from PyInterpreterState which keeps objects alive until the last GC collection: * os.register_at_fork() callbacks * codecs.register() callback * Python audit hooks * sys.modules objects * sys.__dict__ Callbacks keep global variables of a module alive through its __globals__ attribute (namespace of the module where it's defined). ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue44184> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com