This naif code shows no leak: import resource import pickle
c = 0 while True: pickle.dumps(iter([])) if (c % 10000) == 0: max_rss = resource.getrusage(resource.RUSAGE_SELF).ru_maxrss print(f"iteration: {c}, max rss: {max_rss} kb") c += 1 -- https://mail.python.org/mailman/listinfo/python-list