bug <[email protected]> added the comment: class Trie: def __init__(ss): ss.prefixes = [False]*100 def add(ss, i, depth): prefixes = ss.prefixes[:] if depth: t = ss.prefixes[i%100] if not t: t = Trie() prefixes[i%100] = t.add(i//100, depth-1) else: prefixes[i%100] = True n = Trie() n.prefixes = prefixes return n #higher j uses more memory even after print('done') #the old memory should be freed at t = Trie() for j in range(10): t = Trie() for i in range(10**5): t = t.add(i, 3) print('done') while t: continue
________________________________________ PyPy bug tracker <[email protected]> <https://bugs.pypy.org/issue1769> ________________________________________ _______________________________________________ pypy-issue mailing list [email protected] https://mail.python.org/mailman/listinfo/pypy-issue
