-
Notifications
You must be signed in to change notification settings - Fork 18
[BUG] Memory leak in __repr__ #59
Copy link
Copy link
Closed
Labels
Type: BugSomething isn't workingSomething isn't working
Description
Similar to #55, __repr__ leaks memory.
OS version: Ubuntu 20.04.4 LTS
Python3 version (python3 -V -V): Python 3.8.10
Steps to reproduce
Borrowing code from #55:
import resource
import frozendict
print("frozendict version:", frozendict.__version__)
print()
c = 0
while True:
fz = frozendict.frozendict({i: i for i in range(1000)})
_repr = repr(fz)
if (c % 10000) == 0:
max_rss = resource.getrusage(resource.RUSAGE_SELF).ru_maxrss
print(f"iteration: {c}, max rss: {max_rss} kb")
c += 1Actual result
frozendict version: 2.3.2
iteration: 0, max rss: 11712 kb
iteration: 10000, max rss: 118104 kb
iteration: 20000, max rss: 224496 kb
iteration: 30000, max rss: 330888 kb
iteration: 40000, max rss: 437280 kb
iteration: 50000, max rss: 543672 kb
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Type: BugSomething isn't workingSomething isn't working